/** * Returns {@code true} if this key is a match for the given key. This key is * a match for the other key if the other key is also an element key and if * the ID, datatype, and element types all match. */ @Override public boolean matches(MetadataKey<?> other) { if (other == null) { return false; } if (!(other instanceof ElementKey<?, ?>)) { return false; } if (!matchIdAndDatatype(other)) { return false; } return elementType.isAssignableFrom(((ElementKey<?, ?>) other).elementType); }
/** * Returns {@code true} if this key is a match for the given key. This key is * a match for the other key if the other key is also an element key and if * the ID, datatype, and element types all match. */ @Override public boolean matches(MetadataKey<?> other) { if (other == null) { return false; } if (!(other instanceof ElementKey<?, ?>)) { return false; } if (!matchIdAndDatatype(other)) { return false; } return elementType.isAssignableFrom(((ElementKey<?, ?>) other).elementType); }
/** * Returns {@code true} if this key is a match for the given key. This key is * a match for the other key if the other key is also an element key and if * the ID, datatype, and element types all match. */ @Override public boolean matches(MetadataKey<?> other) { if (other == null) { return false; } if (!(other instanceof ElementKey<?, ?>)) { return false; } if (!matchIdAndDatatype(other)) { return false; } return elementType.isAssignableFrom(((ElementKey<?, ?>) other).elementType); }