@Override public boolean matches(Object item) { if (item == null || !(expected.getClass().isAssignableFrom(item.getClass()))) { return false; } @SuppressWarnings("unchecked") // Type checked above. T actual = (T) item; return expected.equals(actual); }
private boolean isDefaultTargeting(T splittingDimensionTargeting) { return splittingDimensionTargeting.equals( splittingDimensionTargeting.getDefaultInstanceForType()); }
@Override public boolean equals(Object object) { if (object instanceof ProtobufDatum) { ProtobufDatum another = (ProtobufDatum) object; return value.equals(another.value); } else { return false; } }
@Override public boolean equals(Object object) { if (object instanceof ProtobufDatum) { ProtobufDatum another = (ProtobufDatum) object; return value.equals(another.value); } else { return false; } }
@Override public boolean isEmpty(T msg) { return msg == null || defaultValue().equals(msg); }
@Override public boolean equals(Object other) { if (other == null) return false; if (other.getClass().isAssignableFrom(this.getClass())) { return this.getProto().equals(this.getClass().cast(other).getProto()); } return false; }
@Override public boolean equals(Object other) { if (other == null) return false; if (other.getClass().isAssignableFrom(this.getClass())) { return this.getProto().equals(this.getClass().cast(other).getProto()); } return false; }
@Override public boolean equals(Object other) { if (other == null) return false; if (other.getClass().isAssignableFrom(this.getClass())) { return this.getProto().equals(this.getClass().cast(other).getProto()); } return false; }
@Override public int compareTo(Datum datum) { if (datum.kind() == TajoDataTypes.Type.PROTOBUF) { return value.equals(((ProtobufDatum)datum).get()) ? 0 : -1; } else { return -1; } }
@Override public int compareTo(Datum datum) { if (datum.type() == TajoDataTypes.Type.PROTOBUF) { return value.equals(((ProtobufDatum)datum).get()) ? 0 : -1; } else { return -1; } }
for (Message msg : msgs) { if (!msg.equals(msgs_array)) { Log.d("Chat", "Message : " + msg.getTitle() + ": " + msg.getMessage()); msgs_array.add(msg); newMsg = true; Log.d("Chat", "New Message ? " + newMsg); } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FDBStoredRecord<?> that = (FDBStoredRecord<?>) o; if (!primaryKey.equals(that.primaryKey)) { return false; } if (!recordType.getName().equals(that.recordType.getName())) { return false; } if (!record.equals(that.record)) { return false; } if (recordVersion == null && that.recordVersion != null || recordVersion != null && !recordVersion.equals(that.recordVersion)) { return false; } return this.keyCount == that.keyCount && this.keySize == that.keySize && this.valueSize == that.valueSize && this.split == that.split && this.versionedInline == that.versionedInline; }
public <T extends Message> List<T> convertJsonArrayToProto( T prototype, JsonNode array, String extensionName) { List<T> messages = Lists.newArrayList(); for (JsonNode messageNode : array) { try { String nodeJson = new ObjectMapper().writeValueAsString(messageNode); T message = convertJsonToProto(prototype, nodeJson, extensionName); if (!message.equals(prototype)) { messages.add(message); } } catch (IOException ex) { // Should not be possible to throw in newer versions of ObjectMapper. diagCollector.addDiag( Diag.error( new SimpleLocation(extensionName), String.format( "The extension %s does not match the schema. It should be a %s. Please refer " + "to documentation of the extension.", extensionName, prototype.getDescriptorForType().getName()))); } } return messages; }
public <T extends Message> List<T> convertJsonArrayToProto( T prototype, JsonNode array, String extensionName) { List<T> messages = Lists.newArrayList(); for (JsonNode messageNode : array) { try { String nodeJson = new ObjectMapper().writeValueAsString(messageNode); T message = convertJsonToProto(prototype, nodeJson, extensionName); if (!message.equals(prototype)) { messages.add(message); } } catch (IOException ex) { // Should not be possible to throw in newer versions of ObjectMapper. diagCollector.addDiag( Diag.error( new SimpleLocation(extensionName), String.format( "The extension %s does not match the schema. It should be a %s. Please refer " + "to documentation of the extension.", extensionName, prototype.getDescriptorForType().getName()))); } } return messages; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof LogStatement) { LogStatement that = (LogStatement) o; return (this.id == that.id()) && ((this.data == null) ? (that.data() == null) : this.data.equals(that.data())) && (this.logOnly == that.logOnly()); } return false; }