static <T extends TypeDefinition<T>> @Nullable T castIfEquals(final @NonNull Class<T> clazz, final @NonNull T type, final @Nullable Object obj) { if (!clazz.isInstance(obj)) { return null; } final @NonNull T other = clazz.cast(obj); return Objects.equals(type.getPath(), other.getPath()) && Objects.equals(type.getBaseType(), other.getBaseType()) && Objects.equals(type.getDefaultValue(), other.getDefaultValue()) && Objects.equals(type.getUnknownSchemaNodes(), other.getUnknownSchemaNodes()) && Objects.equals(type.getUnits(), other.getUnits()) ? other : null; }
static <T extends TypeDefinition<T>> @Nullable T castIfEquals(final @NonNull Class<T> clazz, final @NonNull T type, final @Nullable Object obj) { if (!clazz.isInstance(obj)) { return null; } final @NonNull T other = clazz.cast(obj); return Objects.equals(type.getPath(), other.getPath()) && Objects.equals(type.getBaseType(), other.getBaseType()) && Objects.equals(type.getDefaultValue(), other.getDefaultValue()) && Objects.equals(type.getUnknownSchemaNodes(), other.getUnknownSchemaNodes()) && Objects.equals(type.getUnits(), other.getUnits()) ? other : null; }
static int basicHashCode(final @NonNull TypeDefinition<?> type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null)); }
static int basicHashCode(final @NonNull TypeDefinition<?> type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null)); }
private void emitTypedefNode(final TypeDefinition<?> typedef) { super.writer.startTypedefNode(typedef.getQName()); // Differentiate between derived type and existing type // name. emitTypeNodeDerived(typedef); typedef.getUnits().ifPresent(this::emitUnitsNode); typedef.getDefaultValue().ifPresent(this::emitDefaultNode); emitDocumentedNode(typedef); emitUnknownStatementNodes(typedef.getUnknownSchemaNodes()); super.writer.endNode(); }