/** * Creates and returns a new {@link RevFeatureType} for the given FeatureType with the given * {@link ObjectId id} without verifying the SHA-1 matches the contents of the * {@link RevFeatureType} */ public static RevFeatureType create(ObjectId id, FeatureType ftype) { checkNotNull(id); checkNotNull(ftype); return new RevFeatureTypeImpl(id, ftype); }
public @Override @NonNull RevFeatureType createFeatureType(@NonNull ObjectId id, @NonNull FeatureType ftype) { Collection<PropertyDescriptor> descriptors = ftype.getDescriptors(); descriptors.forEach(d -> { Class<?> binding = d.getType().getBinding(); Objects.requireNonNull(binding, "got null binding for attribute " + d.getName().getLocalPart()); FieldType fieldType = FieldType.forBinding(binding); if (FieldType.NULL == fieldType || FieldType.UNKNOWN == fieldType) { String msg = String.format( "Attribute %s of FeatureType %s is of an unsupported type: %s", d.getName().getLocalPart(), ftype.getName().getLocalPart(), binding.getName()); throw new IllegalArgumentException(msg); } }); return new RevFeatureTypeImpl(id, ftype); }