List of usage examples for java.lang Boolean FALSE
Boolean FALSE
To view the source code for java.lang Boolean FALSE.
Click Source Link
From source file:Main.java
public Boolean queryFrom(TemporalAccessor date) { int month = date.get(ChronoField.MONTH_OF_YEAR); int day = date.get(ChronoField.DAY_OF_MONTH); // Disneyland over Spring Break if ((month == Month.APRIL.getValue()) && ((day >= 3) && (day <= 8))) return Boolean.TRUE; // Smith family reunion on Lake Saugatuck if ((month == Month.AUGUST.getValue()) && ((day >= 8) && (day <= 14))) return Boolean.TRUE; return Boolean.FALSE; }
From source file:com.pactera.edg.am.metamanager.extractor.util.ExtractorContext.java
/** * ????XSLT//from w w w .j a v a 2s . c o m * * @return the xsltTemplate throws Exception ?XLST */ public Templates getXsltTemplate(String xslt) throws IOException, TransformerConfigurationException { // if (!this.templates.containsKey(xslt)) { InputStream in = new DefaultResourceLoader().getResource(xslt).getInputStream(); Source xsltSource = new SAXSource(new InputSource(in)); TransformerFactory factory = TransformerFactory.newInstance(); factory.setAttribute(FeatureKeys.DTD_VALIDATION, Boolean.FALSE); //TODO DTD? factory.setAttribute(FeatureKeys.SCHEMA_VALIDATION, 4); Templates xsltTemplate = factory.newTemplates(xsltSource); // this.templates.put(xslt, xsltTemplate); if (in != null) in.close(); // } return xsltTemplate; }
From source file:com.evolveum.midpoint.web.component.GuiComponents.java
private static IModel<List<Boolean>> createChoices() { return new AbstractReadOnlyModel<List<Boolean>>() { @Override/*from w ww . ja va 2s.c om*/ public List<Boolean> getObject() { List<Boolean> list = new ArrayList<Boolean>(); list.add(null); list.add(Boolean.TRUE); list.add(Boolean.FALSE); return list; } }; }
From source file:org.yamj.core.service.metadata.online.TheMovieDbApiWrapper.java
public String getMovieDbId(String title, int year, boolean throwTempError) { String defaultLanguage = configService.getProperty("themoviedb.language", "en"); boolean includeAdult = configService.getBooleanProperty("themoviedb.includeAdult", Boolean.FALSE); int searchMatch = configService.getIntProperty("themoviedb.searchMatch", 3); MovieInfo movieDb = null;/*from w w w . j a v a 2 s . c o m*/ try { // Search using movie name ResultList<MovieInfo> movieList = tmdbApi.searchMovie(title, 0, defaultLanguage, includeAdult, year, 0, null); LOG.info("Found {} potential matches for {} ({})", movieList.getResults().size(), title, year); // Iterate over the list until we find a match for (MovieInfo m : movieList.getResults()) { String relDate; if (StringUtils.isNotBlank(m.getReleaseDate()) && m.getReleaseDate().length() > 4) { relDate = m.getReleaseDate().substring(0, 4); } else { relDate = ""; } LOG.debug("Checking {} {{})", m.getTitle(), relDate); if (Compare.movies(m, title, String.valueOf(year), searchMatch)) { movieDb = m; break; } } } catch (MovieDbException ex) { if (throwTempError && ResponseTools.isTemporaryError(ex)) { throw new TemporaryUnavailableException( "TheMovieDb service temporary not available: " + ex.getResponseCode(), ex); } LOG.error("Failed retrieving TMDb id for movie '{}': {}", title, ex.getMessage()); LOG.trace("TheMovieDb error", ex); } if (movieDb != null && movieDb.getId() != 0) { LOG.info("TMDB ID found {} for '{}'", movieDb.getId(), title); return String.valueOf(movieDb.getId()); } return null; }
From source file:com.ewcms.publication.PublishIntegratedTest.java
private void updateTemplateSourceStutas() { JpaTemplate template = createJpaTemplate(); template.execute(new JpaCallback<Object>() { @Override//from w w w .j a va 2 s .c o m public Object doInJpa(EntityManager em) throws PersistenceException { em.getTransaction().begin(); String hql = "Update TemplateSource o Set o.release= ?1 Where o.release = ?2"; Query query = em.createQuery(hql); query.setParameter(1, Boolean.FALSE); query.setParameter(2, Boolean.TRUE); query.executeUpdate(); em.getTransaction().commit(); return null; } }); }
From source file:com.csc.fi.ioapi.utils.JerseyJsonLDClient.java
public static Boolean readBooleanFromURL(String url) { try {/* w ww.j a v a 2s . co m*/ Client client = ClientBuilder.newClient(); WebTarget target = client.target(url); Response response = target.request("application/json").get(); if (response.getStatusInfo().getFamily() != Response.Status.Family.SUCCESSFUL) { logger.info("Failed to read boolean from: " + url + " " + response.getStatus()); return Boolean.FALSE; } DataInputStream dis = new DataInputStream(response.readEntity(InputStream.class)); return new Boolean(dis.readBoolean()); } catch (Exception ex) { logger.info("Failed in reading boolean from URL ... returning false"); return Boolean.FALSE; } }
From source file:org.zalando.baigan.TestConfigurationSerialization.java
private Configuration createConfigurationForAppdomain1() { final Condition<Boolean> condition = new Condition<Boolean>("appdomain", new Equals("1"), true); final Set<Condition<Boolean>> conditions = ImmutableSet.of(condition); final Configuration configuration = new Configuration("express.feature.toggle", "Feature toggle", conditions, Boolean.FALSE); return configuration; }
From source file:com.acc.fulfilmentprocess.actions.order.ScheduleForCleanUpAction.java
@Override public Transition executeAction(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "order cannot be null"); if (Boolean.FALSE.equals(order.getFraudulent())) { return Transition.NOK; }// w w w . j a v a2 s.c o m final FraudReportModel lastReport = getLastFraudReportModelWithFraudStatus(order.getFraudReports()); if (lastReport == null) { return Transition.NOK; } final Date lastModification = lastReport.getTimestamp(); final Date currentDate = getTimeService().getCurrentTime(); final Calendar threshold = Calendar.getInstance(); threshold.setTime(currentDate); threshold.add(Calendar.SECOND, -getMinPeriodWaitingForCleanUpInSeconds().intValue()); if (lastModification.before(threshold.getTime())) { return Transition.OK; } else { return Transition.NOK; } }
From source file:com.comcast.oscar.netsnmp.NetSNMP.java
/** * Convert: docsDevNmAccessIp.1 -> .1.3.6.1.2.1.69.1.2.1.2.1 * /*www.j ava 2 s . co m*/ * @param sOID OID either Dotted or Textual OID * @return .1.3.6.x.x.x.x.x */ public static String toDottedOID(String sOID) { boolean localDebug = Boolean.FALSE; if (debug | localDebug) System.out.println("NetSNMP.toDottedOID(): " + sOID); if (isDottedOID(sOID)) { if (debug | localDebug) System.out.println("NetSNMP.toDottedOID() Is a DootedOID -> " + sOID); return sOID; } /* If there is an entry, get OID Lookup*/ if (!CheckOIDDBLookup(sOID).isEmpty()) { return CheckOIDDBLookup(sOID); } /* If not installed, bypass and return input */ if (!isSnmptranslateInstalled()) { return sOID; } String sDottedOID = ""; /* Not a clean way to do it, but it works */ String sSnmpTranslate = Constants.SNMP_TRANSLATE_CMD + Constants.MIB_PARAMETER + Constants.SNMP_TRANSLATE_OID_NAME_2_OID_DEC + sOID.replaceAll("\\s+1", " .iso").replaceAll("\\s+\\.1", " .iso"); if (debug | localDebug) System.out.println("NetSNMP.toDottedOID(): " + sSnmpTranslate); /* Get the String Return */ sDottedOID = runSnmpTranslate(sSnmpTranslate).get(0); /* Add Converted OIDS to Map for later Storage */ UpdateJsonDB(sOID, sDottedOID); if (debug | localDebug) System.out.println("NetSNMP.toDottedOID(): " + sDottedOID); return runSnmpTranslate(sSnmpTranslate).get(0); }
From source file:edu.usu.sdl.openstorefront.service.io.parser.SvcAttributeParser.java
@Override protected void internalParse(CSVReader reader) throws IOException { AttributeType attributeType = new AttributeType(); attributeType.setAttributeType(AttributeType.DI2E_SVCV4); attributeType.setDescription("DI2E SvcV-4 Alignment"); //Default to true....Later an admin would need to determine which ones should only allow one. attributeType.setAllowMultipleFlg(Boolean.TRUE); attributeType.setArchitectureFlg(Boolean.TRUE); attributeType.setVisibleFlg(Boolean.TRUE); attributeType.setImportantFlg(Boolean.TRUE); attributeType.setRequiredFlg(Boolean.FALSE); attributeMap.put(attributeType, new ArrayList<>()); int lineNumber; List<String[]> allLines = reader.readAll(); for (int i = 1; i < allLines.size(); i++) { lineNumber = i;//from www. j ava 2 s . c o m String data[] = allLines.get(i); if (data.length > DESCRIPTION) { String code = data[UID].trim().toUpperCase(); if ("0".equals(code) == false) { code = StringUtils.stripStart(code, "0"); } if (StringUtils.isNotBlank(code)) { AttributeCode attributeCode = new AttributeCode(); AttributeCodePk attributeCodePk = new AttributeCodePk(); attributeCodePk.setAttributeCode(code); attributeCodePk.setAttributeType(attributeType.getAttributeType()); attributeCode.setAttributeCodePk(attributeCodePk); StringBuilder desc = new StringBuilder(); desc.append("<b>Definition:</b>") .append(StringProcessor .stripeExtendedChars(data[DEFINITION].trim().replace("\n", "<br>"))) .append("<br>"); desc.append("<b>Description:</b>") .append(StringProcessor .stripeExtendedChars(data[DESCRIPTION].trim().replace("\n", "<br>"))) .append("<br>"); desc.append("<b>JCA Alignment:</b>") .append(StringProcessor .stripeExtendedChars(data[JCA_ALIGNMENT].trim().replace("\n", "<br>"))) .append("<br>"); desc.append("<b>JCSFL Alignment:</b>") .append(StringProcessor .stripeExtendedChars(data[JCSFL_ALIGNMENT].trim().replace("\n", "<br>"))) .append("<br>"); desc.append("<b>JARM/ESL Alignment:</b>") .append(StringProcessor .stripeExtendedChars(data[JARM_ALIGNMENT].trim().replace("\n", "<br>"))) .append("<br>"); attributeCode.setDescription(desc.toString()); attributeCode.setArchitectureCode(data[CODE].trim().toUpperCase()); attributeCode.setLabel(data[CODE].toUpperCase().trim() + " " + data[LABEL].trim()); attributeMap.get(attributeType).add(attributeCode); } else { log.log(Level.WARNING, MessageFormat.format( "Skipping line: {0} + line is mssing UID or UID doesn't resolve. (0 padding is removed)", lineNumber)); } } else { log.log(Level.WARNING, MessageFormat.format("Skipping line: {0} + line is mssing required fields.", lineNumber)); } } }