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.solidmaps.webapp.dao.LicensePCDAO.java

public LicensePCEntity findByCompanyExpirationDate(Integer idCompany, Calendar dateExpiration) {

    StringBuilder sb = new StringBuilder();
    sb.append("from LicensePCEntity e where e.company.idCompany =:idCompany ");
    sb.append("and e.isActive =:active ");
    sb.append("and e.dateExpiration >= :dateExpiration ");
    sb.append("order by dateExpiration desc ");

    Query query = super.getEm().createQuery(sb.toString());

    query.setParameter("idCompany", idCompany);
    query.setParameter("dateExpiration", dateExpiration);
    query.setParameter("active", Boolean.TRUE);

    @SuppressWarnings("unchecked")
    List<LicensePCEntity> list = query.getResultList();

    if (list != null && !list.isEmpty()) {
        return list.get(0);
    }// www. j a  v  a 2 s.co  m

    // TODO Refatorar essa Gambi aqui. Jogar pra uma Service

    // Se no possui Licena vigente, verifica se a ltima est protocolada
    LicensePCEntity lastProtocoled = this.findByLastProtocoled(idCompany);
    if (lastProtocoled != null && StringUtils.isNotBlank(lastProtocoled.getProtocolRenovation())) {
        return lastProtocoled;
    }

    return null;

}

From source file:com.oddprints.servlets.EditPano.java

@GET
@Path("/basic")
@Produces(MediaType.TEXT_HTML)//from  w ww .j ava  2 s.c  o  m
public Viewable viewBasic(@Context HttpServletRequest req) {
    Edit edit = new Edit();
    req.setAttribute("panoMode", Boolean.TRUE);
    // forward to normal servlet
    return edit.viewBasic(req);
}

From source file:sys.core.json.LocalizacionDataJson.java

@RequestMapping(value = "/nuevo/{usuario},{terminal},{latitude},{longitude},{altitude},{estado}", method = RequestMethod.GET, produces = "application/json")
public @ResponseBody Boolean nuevo(@PathVariable("usuario") Long usuario,
        @PathVariable("terminal") String terminal, @PathVariable("latitude") String latitude,
        @PathVariable("longitude") String longitude, @PathVariable("altitude") String altitude,
        @PathVariable("estado") int estado) throws DAOException {
    boolean methodState = Boolean.TRUE;
    try {//from   w ww .  ja v a  2 s.  c om
        if (usuarioExternoManager.obtenerPorId(usuario) != null) {
            localizacionDataDto = new LocalizacionDataDto();
            localizacionDataDto.setUsuarioExternoDto(usuarioExternoManager.obtenerPorId(usuario));
            localizacionDataDto.setTerminal(terminal);
            localizacionDataDto.setLatitude(latitude);
            localizacionDataDto.setLongitude(longitude);
            localizacionDataDto.setAltitude(altitude);
            localizacionDataDto.setFecha(UtilCore.Fecha.obtenerFechaActualDate());
            localizacionDataDto.setEstado(estado);
            localizacionDataManager.nuevo(localizacionDataDto);
        }
        // System.out.println("Ingreso de Data Satisfactoria");
    } catch (Exception ex) {
        methodState = false;
        //    System.out.println("Error  : " + ex);
    }
    return methodState;
}

From source file:de.hybris.platform.commercefacades.product.converters.populator.FeaturePopulator.java

@Override
public void populate(final Feature source, final FeatureData target) {
    final ClassAttributeAssignmentModel classAttributeAssignment = source.getClassAttributeAssignment();

    // Create the feature
    target.setCode(source.getCode());/*from   w  w w  .  jav a  2 s.  co  m*/
    target.setComparable(Boolean.TRUE.equals(classAttributeAssignment.getComparable()));
    target.setDescription(classAttributeAssignment.getDescription());
    target.setName(source.getName());
    target.setRange(Boolean.TRUE.equals(classAttributeAssignment.getRange()));

    final ClassificationAttributeUnitModel unit = classAttributeAssignment.getUnit();
    if (unit != null) {
        final FeatureUnitData featureUnitData = new FeatureUnitData();
        featureUnitData.setName(unit.getName());
        featureUnitData.setSymbol(unit.getSymbol());
        featureUnitData.setUnitType(unit.getUnitType());
        target.setFeatureUnit(featureUnitData);
    }

    // Create the feature data items
    final List<FeatureValueData> featureValueDataList = new ArrayList<FeatureValueData>();
    for (final FeatureValue featureValue : source.getValues()) {
        final FeatureValueData featureValueData = new FeatureValueData();
        final Object value = featureValue.getValue();
        if (value instanceof ClassificationAttributeValueModel) {
            featureValueData.setValue(((ClassificationAttributeValueModel) value).getName());
        } else if (NumberUtils.isNumber(String.valueOf(value))) {
            featureValueData.setValue(String.valueOf(value).replaceAll("\\.0*$", ""));
        } else {
            featureValueData.setValue(String.valueOf(value));
        }

        featureValueDataList.add(featureValueData);
    }
    target.setFeatureValues(featureValueDataList);

    super.populate(source, target);
}

From source file:com.codepine.api.testrail.internal.IntToBooleanDeserializer.java

@Override
public Boolean deserialize(JsonParser jp, DeserializationContext ctxt)
        throws IOException, JsonProcessingException {
    return jp.getValueAsInt(0) <= 0 ? Boolean.FALSE : Boolean.TRUE;
}

From source file:net.di2e.ecdr.libs.cache.impl.QueryRequestCacheImpl.java

@Override
public void add(String id) {
    put(id, Boolean.TRUE);
}

From source file:com.blogspot.chicchiricco.persistence.AbstractBaseBean.java

/**
 * @param value the boolean value to be represented as integer
 * @return the integer corresponding to the property param
 *///  w w w  .j  a  v  a  2s  . com
public final Integer getBooleanAsInteger(final Boolean value) {
    return value.equals(Boolean.TRUE) ? 1 : 0;
}

From source file:com.hobba.hobaserver.services.security.TokenUtil.java

public String getToken(String kid, String expiration_time) {
    HobaKeysFacadeREST hkfrest = new HobaKeysFacadeREST();
    HobaKeys hk = hkfrest.findHKIDbyKID(kid);
    HobaDevices hd = hk.getIdDevices();//w ww .j a  v a2 s .  co m
    HobaUser hu = hd.getIduser();

    SecureRandom random = new SecureRandom();
    String rand = new BigInteger(256, random).toString(32);
    HobaToken ht = new HobaToken();
    ht.setToken(rand);
    long time = 0;
    try {
        time = Long.parseLong(expiration_time);
        if (time > 0) {
            Date date = new Date(new Date().getTime() + (time * 1000));
            ht.setExpiration(date);
        } else {
            ht.setExpiration(null);
        }
    } catch (Exception e) {
        ht.setExpiration(null);
    }
    ht.setIsValid(Boolean.TRUE);
    ht.setIdUser(hu);

    HobaTokenFacadeREST htfrest = new HobaTokenFacadeREST();
    ht = htfrest.create(ht);
    String token = kid + ":" + rand;
    byte[] encodedBytes = Base64.encodeBase64(token.getBytes());
    token = new String(encodedBytes);
    return token;
}

From source file:org.hyperic.hq.plugin.apache.JkStatusCollector.java

private static void initConstants() {
    if (_filter.size() != 0) {
        return;/*w  w w . j av  a 2  s  . c o m*/
    }
    String[] keys = {
            //type=lb
            "member_count", "good", "degraded", "bad", "busy",
            //type=ajp13 (metrics)
            "state", "errors", "client_errors", "transferred", "read", "busy" };
    for (int i = 0; i < keys.length; i++) {
        _filter.put(keys[i], Boolean.TRUE);
    }
    for (int i = 0; i < WORKER_PROPS.length; i++) {
        _filter.put(WORKER_PROPS[i], Boolean.TRUE);
    }

    _state.put("OK", new Double(Metric.AVAIL_UP));
    _state.put("N/A", new Double(Metric.AVAIL_PAUSED));
    _state.put("REC", new Double(Metric.AVAIL_WARN));
    _state.put("ERR", new Double(Metric.AVAIL_DOWN));
}

From source file:com.hobba.hobaserver.services.security.ChallengeUtil.java

public String getChallenge(String kid, long expirationTime) {
    HobaKeys hk = new HobaKeys();
    HobaKeysFacadeREST hkfrest = new HobaKeysFacadeREST();
    HobaChallengesFacadeREST hcfrest = new HobaChallengesFacadeREST();
    hk = hkfrest.findHKIDbyKID(kid);//from  ww w .  j a v a 2  s . co  m

    SecureRandom random = new SecureRandom();
    String rand = new BigInteger(130, random).toString(32);

    HobaChallenges hc = new HobaChallenges();

    hc.setIdKeys(hk);
    hc.setChalenge(rand);
    if (expirationTime > 0) {
        Date date = new Date(new Date().getTime() + (expirationTime * 100));
        hc.setExpiration(date);
    }
    hc.setExpiration(null);
    hc.setIsValid(Boolean.TRUE);
    hcfrest.create(hc);

    return new String(Base64.encodeBase64(rand.getBytes()));
}