@Override public boolean equals(Object other) { if ( ! (other instanceof SDField)) return false; return super.equals(other); }
@Override public boolean contains(FieldSet o) { if (o instanceof NoFields || o instanceof DocIdOnly) { return true; } if (o instanceof Field) { return equals(o); } return false; }
@Override public boolean equals(Object o) { return o instanceof FieldUpdate && field.equals(((FieldUpdate)o).field) && valueUpdates.equals(((FieldUpdate)o).valueUpdates); }
/** * Adds all the {@link ValueUpdate}s of the given FieldUpdate to this. If the given FieldUpdate refers to a * different {@link Field} than this, this method throws an exception. * * @param update The update whose content to add to this. * @throws IllegalArgumentException If the {@link Field} of the given FieldUpdate does not match this. */ public void addAll(FieldUpdate update) { if (update == null) { return; } if (!field.equals(update.field)) { throw new IllegalArgumentException("Expected " + field + ", got " + update.field + "."); } addValueUpdates(update.valueUpdates); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FieldPathEntry that = (FieldPathEntry) o; if (lookupIndex != that.lookupIndex) return false; if (fieldRef != null ? !fieldRef.equals(that.fieldRef) : that.fieldRef != null) return false; if (lookupKey != null ? !lookupKey.equals(that.lookupKey) : that.lookupKey != null) return false; if (resultingDataType != null ? !resultingDataType.equals(that.resultingDataType) : that.resultingDataType != null) return false; if (type != that.type) return false; if (variableName != null ? !variableName.equals(that.variableName) : that.variableName != null) return false; return true; }
public boolean hasField(Field field, int version) { Field f = getField(field.getId(version), version); return f != null && f.equals(field); }
/** * This method will add a field to a view. All fields must come from the same document type. Not enforced here. * @param field The field to add. * @return Itself for chaining purposes. */ public FieldView add(Field field) { if (fields.containsKey(field.getName())) { if ( ! fields.get(field.getName()).equals(field)) { throw new IllegalArgumentException( "View '" + name + "' already contains a field with name '" + field.getName() + "' and definition : " + fields.get(field.getName()).toString() + ". Your is : " + field.toString()); } } else { fields.put(field.getName(), field); } return this; }
private boolean verifyInheritance(NewDocumentType inherited) { for (Field f : getFields()) { Field inhF = inherited.getField(f.getName()); if (inhF != null && !inhF.equals(f)) { throw new IllegalArgumentException("Inherited document '" + inherited.toString() + "' already contains field '" + inhF.getName() + "'. Can not override with '" + f.getName() + "'."); } } for (Field f : inherited.getAllFields()) { for (NewDocumentType side : inherits.values()) { Field sideF = side.getField(f.getName()); if (sideF != null && !sideF.equals(f)) { throw new IllegalArgumentException("Inherited document '" + side.toString() + "' already contains field '" + sideF.getName() + "'. Document '" + inherited.toString() + "' also defines field '" + f.getName() + "'.Multiple inheritance must be disjunctive."); } } } return true; } public void inherit(NewDocumentType inherited) {