Example usage for java.lang Boolean TRUE

List of usage examples for java.lang Boolean TRUE

Introduction

In this page you can find the example usage for java.lang Boolean TRUE.

Prototype

Boolean TRUE

To view the source code for java.lang Boolean TRUE.

Click Source Link

Document

The Boolean object corresponding to the primitive value true .

Usage

From source file:Main.java

/**
 * Writes the given document to a file (pretty-printed)
 * //from ww  w.  j a  va  2  s  . c  o m
 * @param doc Document to serialize
 * @param file File to write
 */
public static void writeDocument(Document doc, File file) {
    if (doc == null)
        return;
    LSSerializer writer = impl.createLSSerializer();
    writer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
    writer.writeToURI(doc, file.toURI().toString());
}

From source file:Main.java

public static void samsungWimax(Context context, boolean state) {
    //http://forum.xda-developers.com/archive/index.php/t-909206.html
    Object samsungWimaxManager = context.getSystemService("WiMax");
    Method setWimaxEnabled = null;
    try {/*from   w ww.j a v  a 2s  .c o  m*/
        setWimaxEnabled = samsungWimaxManager.getClass().getMethod("setWimaxEnabled",
                new Class[] { Boolean.TYPE });
    } catch (Exception e) {
        e.printStackTrace();
    }
    try {
        if (state) {
            setWimaxEnabled.invoke(samsungWimaxManager, new Object[] { Boolean.TRUE });
        } else {
            setWimaxEnabled.invoke(samsungWimaxManager, new Object[] { Boolean.FALSE });
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.inkubator.hrm.util.StringsUtils.java

public static Boolean isHaveUpperCase(String str) {
    Boolean isCondition = Boolean.FALSE;
    for (int i = str.length() - 1; i >= 0; i--) {

        if (Character.isUpperCase(str.charAt(i))) {
            isCondition = Boolean.TRUE;
        }//from w  w  w  .  ja  v  a 2s  .  c o m
    }
    return isCondition;

}

From source file:Main.java

/**
 * genXml/*from  w ww  . ja va 2  s.  com*/
 * 
 * @param o Object Class.
 * @param path : example c:\path\006DS_AMS20130630.xml
 */
public static void genXml(Object o, String path) {
    try {

        // create JAXB context and initializing Marshaller
        JAXBContext jaxbContext = JAXBContext.newInstance(o.getClass());
        Marshaller jaxbMarshaller = jaxbContext.createMarshaller();

        // for getting nice formatted output
        jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

        //specify the location and name of xml file to be created
        File XMLfile = new File(path);

        // Writing to XML file
        jaxbMarshaller.marshal(o, XMLfile);
        // Writing to console
        jaxbMarshaller.marshal(o, System.out);

    } catch (JAXBException e) {
        // some exception occured
        e.printStackTrace();
    }
}

From source file:Main.java

public static Boolean queryFrom(TemporalAccessor temporal) {
    if (temporal.isSupported(ChronoField.DAY_OF_MONTH) && temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
        int dayOfMonth = temporal.get(ChronoField.DAY_OF_MONTH);
        int weekDay = temporal.get(ChronoField.DAY_OF_WEEK);
        DayOfWeek dayOfWeek = DayOfWeek.of(weekDay);
        if (dayOfMonth == 1 && dayOfWeek == DayOfWeek.MONDAY) {
            return Boolean.TRUE;
        }/*from  w w  w . j  a  v a 2s. c  o m*/
    }
    return Boolean.FALSE;
}

From source file:Main.java

public static Boolean isEmpty(Collection<?> collection) {
    if (collection == null || collection.size() < 1) {
        return Boolean.TRUE;
    }/*ww  w  . j a va  2s  .  c o m*/
    return Boolean.FALSE;
}

From source file:Main.java

public static String serialize(Document document, boolean prettyPrint) {
    DOMImplementationLS impl = getDOMImpl();
    LSSerializer serializer = impl.createLSSerializer();
    // document.normalizeDocument();
    DOMConfiguration config = serializer.getDomConfig();
    if (prettyPrint && config.canSetParameter("format-pretty-print", Boolean.TRUE)) {
        config.setParameter("format-pretty-print", true);
    }//  w ww  .java 2s .  c om
    config.setParameter("xml-declaration", true);
    LSOutput output = impl.createLSOutput();
    output.setEncoding("UTF-8");
    Writer writer = new StringWriter();
    output.setCharacterStream(writer);
    serializer.write(document, output);
    return writer.toString();
}

From source file:Main.java

public static void samsungWimax(Context context, boolean state) {
    //http://forum.xda-developers.com/archive/index.php/t-909206.html
    Object samsungWimaxManager = context.getSystemService("WiMax");
    Method setWimaxEnabled = null;
    try {//from w w w.j  a  v a  2  s . co  m
        setWimaxEnabled = samsungWimaxManager.getClass().getMethod("setWimaxEnabled",
                new Class[] { Boolean.TYPE });
    } catch (Exception e) {
        e.printStackTrace();
    }
    try {
        if (state) {
            if (setWimaxEnabled != null) {
                setWimaxEnabled.invoke(samsungWimaxManager, Boolean.TRUE);
            }
        } else {
            if (setWimaxEnabled != null) {
                setWimaxEnabled.invoke(samsungWimaxManager, Boolean.FALSE);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void createNewResultFileForConnexion() {
    Date currentDate = new Date();
    SimpleDateFormat localDateFormat = new SimpleDateFormat("yyyyMMdd");
    String logPath = LOG_FOLDER + "result_" + localDateFormat.format(currentDate) + "_"
            + System.currentTimeMillis() + ".txt";

    try {/*w ww.ja v a2s  .c  o m*/
        File logFile = new File(logPath);
        FileWriter writer = new FileWriter(logFile, Boolean.TRUE);
        writer.write("Command\tCommand(hex)\tResult\tResult(Hex)\tLatency\n");
        writer.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:Main.java

/**
 * Returns delegate {@code RepaintManager} for {@code component} hierarchy.
 *///ww  w . ja  v a 2s .c  o m
public static RepaintManager getDelegateRepaintManager(Component component) {
    RepaintManager delegate = null;
    if (Boolean.TRUE == SunToolkit.targetToAppContext(component).get(DELEGATE_REPAINT_MANAGER_KEY)) {
        while (delegate == null && component != null) {
            while (component != null && !(component instanceof JComponent)) {
                component = component.getParent();
            }
            if (component != null) {
                delegate = (RepaintManager) ((JComponent) component)
                        .getClientProperty(DELEGATE_REPAINT_MANAGER_KEY);
                component = component.getParent();
            }

        }
    }
    return delegate;
}