- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Gson g =
new Gson()
GsonBuilder gsonBuilder;gsonBuilder.create()
new GsonBuilder().create()
- Smart code suggestions by Codota
}
/** * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false}, * handling {@code null} by returning {@code true}.</p> * * <pre> * BooleanUtils.isNotFalse(Boolean.TRUE) = true * BooleanUtils.isNotFalse(Boolean.FALSE) = false * BooleanUtils.isNotFalse(null) = true * </pre> * * @param bool the boolean to check, null returns {@code true} * @return {@code true} if the input is null or true * @since 2.3 */ public static boolean isNotFalse(final Boolean bool) { return !isFalse(bool); }
public void initBenchmarkReportDirectory(File benchmarkDirectory) { String timestampString = startingTimestamp.format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HHmmss")); if (StringUtils.isEmpty(name)) { name = timestampString; } if (!benchmarkDirectory.mkdirs()) { if (!benchmarkDirectory.isDirectory()) { throw new IllegalArgumentException("The benchmarkDirectory (" + benchmarkDirectory + ") already exists, but is not a directory."); } if (!benchmarkDirectory.canWrite()) { throw new IllegalArgumentException("The benchmarkDirectory (" + benchmarkDirectory + ") already exists, but is not writable."); } } int duplicationIndex = 0; do { String directoryName = timestampString + (duplicationIndex == 0 ? "" : "_" + duplicationIndex); duplicationIndex++; benchmarkReportDirectory = new File(benchmarkDirectory, BooleanUtils.isFalse(aggregation) ? directoryName : directoryName + "_aggregation"); } while (!benchmarkReportDirectory.mkdir()); for (ProblemBenchmarkResult problemBenchmarkResult : unifiedProblemBenchmarkResultList) { problemBenchmarkResult.makeDirs(); } }
private <Solution_> ProblemBenchmarkResult<Solution_> buildProblemBenchmark(SolverConfigContext solverConfigContext, PlannerBenchmarkResult plannerBenchmarkResult, ProblemProvider<Solution_> problemProvider) { ProblemBenchmarkResult<Solution_> problemBenchmarkResult = new ProblemBenchmarkResult<>(plannerBenchmarkResult); problemBenchmarkResult.setName(problemProvider.getProblemName()); problemBenchmarkResult.setProblemProvider(problemProvider); problemBenchmarkResult.setWriteOutputSolutionEnabled( writeOutputSolutionEnabled == null ? false : writeOutputSolutionEnabled); List<ProblemStatistic> problemStatisticList; if (BooleanUtils.isFalse(problemStatisticEnabled)) { if (!ConfigUtils.isEmptyCollection(problemStatisticTypeList)) { throw new IllegalArgumentException("The problemStatisticEnabled (" + problemStatisticEnabled + ") and problemStatisticTypeList (" + problemStatisticTypeList + ") can be used together."); } problemStatisticList = Collections.emptyList(); } else { List<ProblemStatisticType> problemStatisticTypeList_ = (problemStatisticTypeList == null) ? Collections.singletonList(ProblemStatisticType.BEST_SCORE) : problemStatisticTypeList; problemStatisticList = new ArrayList<>(problemStatisticTypeList_.size()); for (ProblemStatisticType problemStatisticType : problemStatisticTypeList_) { problemStatisticList.add(problemStatisticType.buildProblemStatistic(problemBenchmarkResult)); } } problemBenchmarkResult.setProblemStatisticList(problemStatisticList); problemBenchmarkResult.setSingleBenchmarkResultList(new ArrayList<>()); return problemBenchmarkResult; }
Collection<GenuineVariableDescriptor> variableDescriptors = deduceVariableDescriptorList( entitySelector.getEntityDescriptor(), variableNameIncludeList); if (BooleanUtils.isFalse(subPillarEnabled) && (minimumSubPillarSize != null || maximumSubPillarSize != null)) { throw new IllegalArgumentException("The pillarSelectorConfig (" + this
@Override public boolean enableSortField() { return BooleanUtils.isFalse(discontinuous) && unit != TimeUnit.YEAR; }
/** * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false}, * handling {@code null} by returning {@code true}.</p> * * <pre> * BooleanUtils.isNotFalse(Boolean.TRUE) = true * BooleanUtils.isNotFalse(Boolean.FALSE) = false * BooleanUtils.isNotFalse(null) = true * </pre> * * @param bool the boolean to check, null returns {@code true} * @return {@code true} if the input is null or true * @since 2.3 */ public static boolean isNotFalse(final Boolean bool) { return !isFalse(bool); }
/** * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false}, * handling {@code null} by returning {@code true}.</p> * * <pre> * BooleanUtils.isNotFalse(Boolean.TRUE) = true * BooleanUtils.isNotFalse(Boolean.FALSE) = false * BooleanUtils.isNotFalse(null) = true * </pre> * * @param bool the boolean to check, null returns {@code true} * @return {@code true} if the input is null or true * @since 2.3 */ public static boolean isNotFalse(final Boolean bool) { return !isFalse(bool); }
/** * <p>Checks if a {@code Boolean} value is {@code false}, * handling {@code null} by returning {@code false}.</p> * * <pre> * BooleanUtils.isFalse(Boolean.TRUE) = false * BooleanUtils.isFalse(Boolean.FALSE) = true * BooleanUtils.isFalse(null) = false * </pre> * * @param bool the boolean to check, null returns {@code false} * @return {@code true} only if the input is non-null and false * @since 2.1 */ public static boolean isFalse(Boolean bool) { return org.apache.commons.lang3.BooleanUtils.isFalse(bool); }
/** * <p>Checks if a {@code Boolean} value is <i>not</i> {@code false}, * handling {@code null} by returning {@code true}.</p> * * <pre> * BooleanUtils.isNotFalse(Boolean.TRUE) = true * BooleanUtils.isNotFalse(Boolean.FALSE) = false * BooleanUtils.isNotFalse(null) = true * </pre> * * @param bool the boolean to check, null returns {@code true} * @return {@code true} if the input is null or true * @since 2.3 */ public static boolean isNotFalse(final Boolean bool) { return !isFalse(bool); }
@Override protected void updateText() { if (operator == Op.NOT_EMPTY) { if (BooleanUtils.isTrue((Boolean) param.getValue())) { text = text.replace("not exists", "exists"); } else if (BooleanUtils.isFalse((Boolean) param.getValue()) && !text.contains("not exists")) { text = text.replace("exists ", "not exists "); } } if (!isCollection) { if (operator == Op.ENDS_WITH || operator == Op.STARTS_WITH || operator == Op.CONTAINS || operator == Op.DOES_NOT_CONTAIN) { Matcher matcher = LIKE_PATTERN.matcher(text); if (matcher.find()) { String escapeCharacter = ("\\".equals(QueryUtils.ESCAPE_CHARACTER) || "$".equals(QueryUtils.ESCAPE_CHARACTER)) ? QueryUtils.ESCAPE_CHARACTER + QueryUtils.ESCAPE_CHARACTER : QueryUtils.ESCAPE_CHARACTER; text = matcher.replaceAll("$1 ESCAPE '" + escapeCharacter + "' "); } } } else { if (operator == Op.CONTAINS) { text = text.replace("not exists", "exists"); } else if (operator == Op.DOES_NOT_CONTAIN && !text.contains("not exists")) { text = text.replace("exists ", "not exists "); } } }
private static boolean isRejected(SInstance instance) { return isFalse(instance.asAtrAnnotation().approved()); }
else if (BooleanUtils.isFalse(isParentTagNull))
private CurseFile checkBackupVersions(String releaseType, CurseFile curseFile, JSONObject fileListJson, String mcVersion, CurseFile newMod) { CurseFile returnMod = newMod; for (String backupVersion : arguments.getBackupVersions()) { log.debug("No files found for Minecraft {}, checking backup version {}", mcVersion, backupVersion); returnMod = getLatestVersion(releaseType, curseFile, fileListJson, backupVersion); if (BooleanUtils.isFalse(newMod.getSkipDownload())) { curseFile.setSkipDownload(null); log.debug("Found update for {} in Minecraft {}", curseFile.getName(), backupVersion); break; } } return returnMod; }
/** * Returns true if the given instance or any of its children is annotated with an refusal * @param instance * @return */ public boolean hasAnyRefusalOnTree(SInstance instance) { return SInstances.hasAny(instance, i -> hasAnnotation(i) && BooleanUtils.isFalse(i.asAtrAnnotation().annotation().getApproved())); }
/** Retorna true se a instância ou algum de seus filhos tiver uma anotação marcadada como não aprovada. */ public boolean hasAnyRefusal(SInstance instance) { return SInstances.hasAny(instance, i -> hasAnnotation(i) && BooleanUtils.isFalse(i.asAtrAnnotation().annotation().getApproved())); }
@Override public void handleEvent(Event event) { if (!(event.getContext() instanceof DocumentEventContext)) { return; } DocumentEventContext ctx = (DocumentEventContext) event.getContext(); DocumentModel srcDoc = ctx.getSourceDocument(); if (!TYPE_NAME.equals(srcDoc.getType())) { return; } CoreSession session = ctx.getCoreSession(); List<String> flags = Arrays.asList(PROP_LATEST_FT, PROP_LATEST_LTS); flags.forEach(flag -> { if (isFalse((Boolean) srcDoc.getPropertyValue(flag))) { return; } String query = String.format(DISTRIBUTION_QUERY, TYPE_NAME, flag); session.query(query) .stream() .filter(doc -> srcDoc.getId() == null || !doc.getId().equals(srcDoc.getId())) .forEach(doc -> { doc.setPropertyValue(flag, false); session.saveDocument(doc); }); }); }
@SuppressWarnings("unchecked") protected TextField createTextField(Datatype datatype) { TextField textField = uiComponents.create(TextField.class); textField.setDatatype(datatype); if (!BooleanUtils.isFalse(editable)) { FilterHelper.ShortcutListener shortcutListener = new FilterHelper.ShortcutListener("add", new KeyCombination(KeyCombination.Key.ENTER)) { @Override public void handleShortcutPressed() { _addValue(textField); } }; filterHelper.addShortcutListener(textField, shortcutListener); } return textField; }
@Override public boolean isAvailable(Node node, TemplateDefinition templateDefinition) { if (node == null || templateDefinition == null) { return false; } // Templates with visible property is set to false are not available if (BooleanUtils.isFalse(templateDefinition.getVisible())) { return false; } if (templateDefinition instanceof ResourceTemplate && JcrResourceOrigin.RESOURCES_WORKSPACE.equals(getNodeWorkspaceName(node))) { return true; } // Without valid site we default to fallback final Site site = siteFunctions.site(node); if (site == null) { return fallbackTemplateAvailability.isAvailable(node, templateDefinition); } // Without valid template settings or availability we default to fallback too final TemplateSettings templateSettings = site.getTemplates(); if (templateSettings == null || templateSettings.getAvailability() == null) { return fallbackTemplateAvailability.isAvailable(node, templateDefinition); } return site.getTemplates().getAvailability().isAvailable(node, templateDefinition); }
private <T extends ObjectType> String addObject(PrismObject<T> object, boolean overwrite, ImportOptionsType importOptions, Task task, OperationResult parentResult) throws ObjectAlreadyExistsException, SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException { ObjectDelta<T> delta = DeltaFactory.Object.createAddDelta(object); Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(delta); ModelExecuteOptions modelOptions; if (importOptions.getModelExecutionOptions() != null) { modelOptions = ModelExecuteOptions.fromModelExecutionOptionsType(importOptions.getModelExecutionOptions()); } else { modelOptions = new ModelExecuteOptions(); } if (modelOptions.getRaw() == null) { modelOptions.setRaw(true); } if (modelOptions.getOverwrite() == null) { modelOptions.setOverwrite(overwrite); } if (isFalse(importOptions.isEncryptProtectedValues()) && modelOptions.getNoCrypt() == null) { modelOptions.setNoCrypt(true); } modelService.executeChanges(deltas, modelOptions, task, parentResult); return deltas.iterator().next().getOid(); }