+ @NonNull List<PatternConstraint> getPatternConstraints();
+
+ static int hashCode(final @NonNull StringTypeDefinition type) {
+ return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(),
+ type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getLengthConstraint().orElse(null),
+ type.getPatternConstraints());
+ }
+
+ static boolean equals(final @NonNull StringTypeDefinition type, final @Nullable Object obj) {
+ if (type == obj) {
+ return true;
+ }
+
+ final StringTypeDefinition other = TypeDefinitions.castIfEquals(StringTypeDefinition.class, type, obj);
+ return other != null && type.getLengthConstraint().equals(other.getLengthConstraint())
+ && type.getPatternConstraints().equals(other.getPatternConstraints());
+ }
+
+ static String toString(final @NonNull StringTypeDefinition type) {
+ return TypeDefinitions.toStringHelper(type).add("length", type.getLengthConstraint().orElse(null))
+ .add("patterns", type.getPatternConstraints()).toString();
+ }