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:WeakHashSet.java

public boolean remove(Object o) {
    return map.remove(o) == Boolean.TRUE;
}

From source file:com.amazonaws.http.HttpRequestTimer.java

/**
 * {@link ScheduledThreadPoolExecutor#setRemoveOnCancelPolicy(boolean)} is not available in Java
 * 6 so we invoke it with reflection to be able to compile against Java 6.
 * /*from   ww  w  .  j  ava2 s.c o  m*/
 * @param executor
 */
private static void safeSetRemoveOnCancel(ScheduledThreadPoolExecutor executor) {
    try {
        executor.getClass().getMethod("setRemoveOnCancelPolicy", boolean.class).invoke(executor, Boolean.TRUE);
    } catch (IllegalAccessException e) {
        throwSetRemoveOnCancelException(e);
    } catch (IllegalArgumentException e) {
        throwSetRemoveOnCancelException(e);
    } catch (InvocationTargetException e) {
        throwSetRemoveOnCancelException(e.getCause());
    } catch (NoSuchMethodException e) {
        throw new AmazonClientException(
                "The request timeout feature is only available for Java 1.7 and above.");
    } catch (SecurityException e) {
        throw new AmazonClientException("The request timeout feature needs additional permissions to function.",
                e);
    }
}

From source file:io.pivotal.cla.mvc.support.ImportedSignaturesSessionAttr.java

public boolean getValue() {
    return Boolean.TRUE.equals(webRequest.getAttribute(ATTR_NAME, RequestAttributes.SCOPE_SESSION));
}

From source file:com.civis.utils.html.parser.HtmlParseFilter.java

public HtmlParseFilter() {
    setNullableText(Boolean.TRUE);
    setLinkMatcherList(Collections.emptyList());
    setIgnore(Collections.emptyList());
}

From source file:org.dbrain.data.jackson.serializers.JacksonSerializationUtils.java

public static Value parseValue(JsonParser parser, DeserializationContext ctxt) throws IOException {
    JsonToken token = getToken(parser);/* www . j a  va 2  s. c o  m*/
    if (token != null) {
        Value result;
        switch (token) {
        case VALUE_STRING:
            result = Value.of(parser.getValueAsString());
            break;
        case VALUE_NUMBER_FLOAT:
            result = Value.of(parser.getDoubleValue());
            break;
        case VALUE_NUMBER_INT:
            result = Value.of(parser.getBigIntegerValue());
            break;
        case VALUE_NULL:
            result = NullValueImpl.NULL;
            break;
        case VALUE_TRUE:
            result = Value.of(Boolean.TRUE);
            break;
        case VALUE_FALSE:
            result = Value.of(Boolean.FALSE);
            break;
        case START_OBJECT: {
            ValueMap values = ValueMap.newInstance();
            while (parser.nextToken() == JsonToken.FIELD_NAME) {
                String key = parser.getCurrentName();
                parser.nextToken();
                Value v = parseValue(parser, ctxt);
                if (v == null) {
                    throw ctxt.wrongTokenException(parser, JsonToken.START_OBJECT, "Expected Value");
                }
                values.put(key, v);
            }
            if (getToken(parser) == JsonToken.END_OBJECT) {
                parser.clearCurrentToken();
            } else {
                throw ctxt.wrongTokenException(parser, JsonToken.END_OBJECT, null);
            }
            result = values;
        }
            break;
        case START_ARRAY: {
            ValueList values = ValueList.newInstance();
            while (parser.nextToken() != JsonToken.END_ARRAY) {
                Value v = parseValue(parser, ctxt);
                if (v == null) {
                    throw ctxt.wrongTokenException(parser, JsonToken.START_OBJECT, "Expected Value");
                }
                values.add(v);
            }
            if (getToken(parser) == JsonToken.END_ARRAY) {
                parser.clearCurrentToken();
            } else {
                throw ctxt.wrongTokenException(parser, JsonToken.END_ARRAY, null);
            }
            result = values;
        }
            break;
        default:
            throw ctxt.wrongTokenException(parser, JsonToken.START_OBJECT, "Expected Value");
        }
        return result;
    } else {
        return null;
    }
}

From source file:gallery.web.validator.wallpaper.WallpaperInsertBindValidator.java

@Override
public BindingResult bindAndValidate(Object command, HttpServletRequest request) {
    BindingResult res = super.bindAndValidate(command, request);
    if (!res.hasErrors()) {
        //setting user
        Wallpaper p = (Wallpaper) command;
        p.setActive(Boolean.TRUE);
        p.setUser(security.Utils.getCurrentUser(request));
    }/*from   www  .  j av  a2  s .  c om*/
    return res;
}

From source file:org.fishwife.jrugged.spring.retry.PredicateBinaryExceptionClassifier.java

/***
 * Constructor.//from  ww  w.  j  a  va 2 s  .  co m
 *
 * @param predicate The predicate to use to check the exception
 */
public PredicateBinaryExceptionClassifier(Predicate<Throwable> predicate) {
    super(Boolean.TRUE);
    this.predicate = predicate;
}

From source file:io.lavagna.web.helper.UserSession.java

public static boolean isUserAnonymous(HttpServletRequest req) {
    return Boolean.TRUE.equals(req.getSession().getAttribute(AUTH_USER_IS_ANONYMOUS));
}

From source file:HTML.java

/**
 * Utility method to convert HTML to text.
 * @param html The string containing HTML.
 * @return a String containing the derived text .
 */// w  ww. j a  va 2s. c om
public static final String html2text(String html) {
    EditorKit kit = new HTMLEditorKit();
    Document doc = kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    try {
        Reader reader = new StringReader(html);
        kit.read(reader, doc, 0);
        return doc.getText(0, doc.getLength());
    } catch (Exception e) {

        return "";
    }
}

From source file:com.inkubator.securitycore.util.UserInfoUtil.java

public static Boolean hasRole(String roleName) {
    Boolean isHasRole = Boolean.FALSE;
    for (String role : getRoles()) {
        if (role.equalsIgnoreCase(roleName)) {
            isHasRole = Boolean.TRUE;
            break;
        }/*from   w ww.  ja  v  a  2  s . c om*/
    }
    return isHasRole;
}