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:com.jim.im.message.config.ImMessageListener.java

@Override
public void onMessage(Message message) {
    try {//  w ww  . j a  va 2 s . co  m
        String isFromPusher = message.getStringProperty(IMConstant.IS_FROM_PUSHER);
        if (!StringUtil.equals(isFromPusher, Boolean.TRUE.toString())) {
            ImMessage imMessage = (ImMessage) messageConverter.fromMessage(message);
            messageService.pushMessage(imMessage);
        }
    } catch (JMSException e) {
        LOGGER.error("From ActiveMQ message delivery failure.", e);
    } catch (ImException e) {
        LOGGER.error("From ActiveMQ message delivery failure.", e);
    }
}

From source file:com.seajas.search.utilities.remoting.JsonHttpSupport.java

@Test
public void invocation() throws Exception {
    String method = "testMethodName";
    Class[] types = new Class[] { Boolean.class, String.class, Number.class };
    Object[] arguments = new Object[] { Boolean.TRUE, null, new Integer(2) };
    RemoteInvocation invocation = new RemoteInvocation(method, types, arguments);

    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    executor.writeRemoteInvocation(invocation, buffer);
    ByteArrayInputStream stream = new ByteArrayInputStream(buffer.toByteArray());
    RemoteInvocation deserialized = exporter.readRemoteInvocation(null, stream);
    assertEquals("method", method, deserialized.getMethodName());
    assertArrayEquals("types", types, deserialized.getParameterTypes());
    assertArrayEquals("arguments", arguments, deserialized.getArguments());
}

From source file:fedora.server.security.servletfilters.Base.java

public static final boolean booleanValue(String string) throws Exception {
    if (Boolean.TRUE.toString().equals(string) || Boolean.FALSE.toString().equals(string)) {
        return (new Boolean(string)).booleanValue();
    } else {//ww  w.  j a va2  s  .  c o m
        throw new Exception("does not represent a boolean");
    }
}

From source file:com.sysomos.test.SysomosJsonSerDeTest.java

@Test
public void Test() {
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);

    InputStream is = SysomosJsonSerDeTest.class.getResourceAsStream("/sysomos_jsons.txt");
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);

    try {//from  w  w w  .  ja va  2 s.  c  o  m
        while (br.ready()) {
            String line = br.readLine();
            LOGGER.debug(line);

            Sysomos ser = mapper.readValue(line, Sysomos.class);

            String des = mapper.writeValueAsString(ser);
            LOGGER.debug(des);
        }
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:ch.ralscha.extdirectspring.bean.ExtDirectFormPostResultTest.java

@Test
public void testExtDirectFormPostResultBoolean() {
    ExtDirectFormPostResult result = new ExtDirectFormPostResult(true);
    assertThat(result.getResult()).hasSize(1).contains(MapEntry.entry("success", Boolean.TRUE));

    result = new ExtDirectFormPostResult(false);
    assertThat(result.getResult()).hasSize(1).contains(MapEntry.entry("success", Boolean.FALSE));
}

From source file:org.easit.core.controllers.facebook.FacebookAfterConnectInterceptor.java

@Override
public void preConnect(ConnectionFactory<Facebook> connectionFactory, MultiValueMap<String, String> parameters,
        WebRequest request) {//from  w  w  w  .j a v a 2  s.c o  m
    parameters.set("approval_prompt", "force");
    if (StringUtils.hasText(request.getParameter(POST_TO_WALL_PARAMETER))) {
        request.setAttribute(POST_TO_WALL_ATTRIBUTE, Boolean.TRUE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.codspire.mojo.artifactlookup.ProcessResponseTest.java

@Before
public void initMock() throws Exception {
    when(log.isDebugEnabled()).thenReturn(Boolean.TRUE);

    plugInConfig = new PropertiesConfiguration("artifact-lookup-maven-plugin.properties");
}

From source file:helma.swarm.SwarmIDGenerator.java

public void init(Application app) {
    this.app = app;
    nmgr = app.getNodeManager();//www  .ja  va2  s  .  co  m
    String logName = new StringBuffer("helma.").append(app.getName()).append(".swarm").toString();
    log = app.getLogger(logName);
    try {
        PullPushAdapter adapter = ChannelUtils.getAdapter(app);
        dispatcher = new MessageDispatcher(adapter, ChannelUtils.IDGEN, null, this, this);
        Channel channel = (Channel) adapter.getTransport();
        channel.setOpt(Channel.VIEW, Boolean.TRUE);
        address = channel.getLocalAddress();
        view = channel.getView();
        log.info("SwarmIDGenerator: Got initial view: " + view);
    } catch (Exception e) {
        log.error("SwarmIDGenerator: Error starting/joining channel", e);
        e.printStackTrace();
    }
}

From source file:io.opencensus.contrib.spring.sleuth.v1x.OpenCensusSleuthSpan.java

@SuppressWarnings("deprecation")
private static SpanContext fromSleuthSpan(org.springframework.cloud.sleuth.Span span) {
    return SpanContext.create(
            TraceId.fromBytes(ByteBuffer.allocate(TraceId.SIZE).putLong(span.getTraceIdHigh())
                    .putLong(span.getTraceId()).array()),
            SpanId.fromBytes(ByteBuffer.allocate(SpanId.SIZE).putLong(span.getSpanId()).array()),
            Boolean.TRUE.equals(span.isExportable()) ? sampledOptions : notSampledOptions);
}

From source file:cz.cvut.kbss.wpa.service.impl.ProposalServiceImpl.java

public void agreedProposal(ProposalDTO p) {
    Proposal pr = genericHibernateJpaDAO.getById(p.getId(), Proposal.class);
    pr.setMatchAgreed(true);/*ww w  .ja  v  a2 s  .  com*/
    genericHibernateJpaDAO.saveOrUpdate(pr);
    p.setAgreed(Boolean.TRUE);
}