/** * If a {@code desiredType} is specified, returns true only if the {@code actualType} is * identical. Otherwise, returns true as long as {@code actualType} is present. */ private static boolean matchesType( Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType) { return desiredType.isPresent() ? desiredType.equals(actualType) : actualType.isPresent(); }
/** * If a {@code desiredType} is specified, returns true only if the {@code actualType} is * identical. Otherwise, returns true as long as {@code actualType} is present. */ private static boolean matchesType( Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType) { return desiredType.isPresent() ? desiredType.equals(actualType) : actualType.isPresent(); }
/** * If a {@code desiredType} is specified, returns true only if the {@code actualType} is * identical. Otherwise, returns true as long as {@code actualType} is present. */ private static boolean matchesType( Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType) { return desiredType.isPresent() ? desiredType.equals(actualType) : actualType.isPresent(); }
@VisibleForTesting KafkaDeserializerExtractor(WorkUnitState state, Optional<Deserializers> deserializerType, Deserializer<?> kafkaDeserializer, KafkaSchemaRegistry<?, ?> kafkaSchemaRegistry) { super(state); this.kafkaDeserializer = kafkaDeserializer; this.kafkaSchemaRegistry = kafkaSchemaRegistry; this.latestSchema = (deserializerType.equals(Optional.of(Deserializers.CONFLUENT_AVRO))) ? (Schema) getSchema() : null; }
@Override public boolean equals( final Object o ) { if ( this == o ) { return true; } if ( !( o instanceof SimpleSearchByEdgeType ) ) { return false; } final SimpleSearchByEdgeType that = ( SimpleSearchByEdgeType ) o; if ( maxTimestamp != that.maxTimestamp ) { return false; } if ( !last.equals( that.last ) ) { return false; } if ( !node.equals( that.node ) ) { return false; } if ( !type.equals( that.type ) ) { return false; } return true; }
/** * Find star select item via table name or alias. * * @param tableNameOrAlias table name or alias * @return star select item via table name or alias */ public Optional<StarSelectItem> findStarSelectItem(final String tableNameOrAlias) { Optional<Table> table = getTables().find(tableNameOrAlias); if (!table.isPresent()) { return Optional.absent(); } for (SelectItem each : items) { if (!(each instanceof StarSelectItem)) { continue; } StarSelectItem starSelectItem = (StarSelectItem) each; if (starSelectItem.getOwner().isPresent() && getTables().find(starSelectItem.getOwner().get()).equals(table)) { return Optional.of(starSelectItem); } } return Optional.absent(); }
public MediaType getContentType() { Optional<MediaType> optionalType = toContentType(Files.getFileExtension(filename)); Optional<Charset> targetCharset = toCharset(optionalType); MediaType type = optionalType.or(DEFAULT_CONTENT_TYPE_WITH_CHARSET); if (targetCharset.isPresent() && !type.charset().equals(targetCharset)) { return type.withCharset(targetCharset.get()); } return type; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ErrorProneOptions.PatchingOptions) { ErrorProneOptions.PatchingOptions that = (ErrorProneOptions.PatchingOptions) o; return (this.namedCheckers.equals(that.namedCheckers())) && (this.inPlace == that.inPlace()) && (this.baseDirectory.equals(that.baseDirectory())) && (this.customRefactorer.equals(that.customRefactorer())) && (this.importOrganizer.equals(that.importOrganizer())); } return false; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof StaticImports.StaticImportInfo) { StaticImports.StaticImportInfo that = (StaticImports.StaticImportInfo) o; return (this.importedName.equals(that.importedName())) && (this.canonicalName.equals(that.canonicalName())) && (this.simpleName.equals(that.simpleName())) && (this.members.equals(that.members())); } return false; }
private Optional<StyleInfo> determineStyle() { if (declaringType().isPresent()) { DeclaringType type = declaringType().get(); Optional<DeclaringType> enclosing = type.enclosingOf(); if (enclosing.isPresent()) { Optional<StyleInfo> enclosingStyle = enclosing.get().style(); if (enclosing.get() != type) { Optional<StyleInfo> style = type.style(); if (style.isPresent() && enclosingStyle.isPresent() && !style.equals(enclosingStyle)) { warnAboutIncompatibleStyles(); } } if (enclosingStyle.isPresent()) { return enclosingStyle; } } else { Optional<StyleInfo> style = type.style(); if (style.isPresent()) { return style; } Optional<DeclaringType> topLevel = type.enclosingTopLevel(); if (topLevel.isPresent() && topLevel.get().style().isPresent()) { return topLevel.get().style(); } } } return packageOf().style(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } ConversionConfig that = (ConversionConfig) o; if (isUpdateViewAlwaysEnabled() != that.isUpdateViewAlwaysEnabled()) { return false; } if (!getDestinationFormat().equals(that.getDestinationFormat())) { return false; } return getDestinationViewName().equals(that.getDestinationViewName()); }
case IGNORED: sb.append("ignored: "); if (actualFieldIndex().equals(expectedFieldIndex())) { sb.append(indexed(fieldPrefix, actualFieldIndex())); } else {
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SingularityTaskState that = (SingularityTaskState) o; if (pending != that.pending) { return false; } if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) { return false; } if (pendingTaskId != null ? !pendingTaskId.equals(that.pendingTaskId) : that.pendingTaskId != null) { return false; } if (runId != null ? !runId.equals(that.runId) : that.runId != null) { return false; } if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) { return false; } return taskHistory != null ? taskHistory.equals(that.taskHistory) : that.taskHistory == null; }
private boolean userMatches(Optional<String> input, SingularityUser user) { return input.isPresent() && (user.getEmail().equals(input) || user.getId().equals(input.get()) || user.getName().equals(input.get())); }
@Override public void serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception { if (_nullSerializer == null) { Object value = get(bean); if (value == null || Optional.absent().equals(value)) { return; } } super.serializeAsField(bean, gen, prov); } }
@Override public void serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception { if (_nullSerializer == null) { Object value = get(bean); if (value == null || Optional.absent().equals(value)) { return; } } super.serializeAsField(bean, gen, prov); } }
public void checkForAuthorizedChanges(SingularityRequest request, SingularityRequest oldRequest, SingularityUser user) { if (!authEnabled) { return; } checkForbidden(user.isAuthenticated(), "Not Authenticated!"); if (!oldRequest.getReadWriteGroups().equals(request.getReadWriteGroups()) || !oldRequest.getGroup().equals(request.getGroup())) { // If group or readWriteGroups are changing, a user must be authorized for both the old and new request groups checkForAuthorization(oldRequest, user, SingularityAuthorizationScope.WRITE); checkForAuthorization(request, user, SingularityAuthorizationScope.WRITE); } }
@Override //generated-code public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LdLocale ldLocale = (LdLocale) o; if (!language.equals(ldLocale.language)) return false; if (!region.equals(ldLocale.region)) return false; if (!script.equals(ldLocale.script)) return false; return true; }
public void handleIn(RestxRequest req, RestxResponse resp) { if (req.getHeader("If-None-Match").equals(Optional.of(value))) { throw new WebException(HttpStatus.NOT_MODIFIED); } else { cacheControl.writeTo(resp); resp.setHeader("ETag", value); } }