static boolean equals(final @NonNull LeafrefTypeDefinition type, final @Nullable Object obj) { if (type == obj) { return true; } final LeafrefTypeDefinition other = TypeDefinitions.castIfEquals(LeafrefTypeDefinition.class, type, obj); return other != null && type.getPathStatement().equals(other.getPathStatement()); }
static int hashCode(final @NonNull LeafrefTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getPathStatement()); }
private void emitLeafrefSpecification(final LeafrefTypeDefinition typeDefinition) { emitPathNode(typeDefinition.getPathStatement()); if (YangVersion.VERSION_1_1 == super.yangVersion) { emitRequireInstanceNode(typeDefinition.requireInstance()); } }
private Module getBaseTypeModule(final LeafrefTypeDefinition leafrefType) { /* * Find the first definition of supplied leafref type and return the * module which contains this definition. */ LeafrefTypeDefinition baseLeafRefType = leafrefType; while (baseLeafRefType.getBaseType() != null) { baseLeafRefType = baseLeafRefType.getBaseType(); } return schemaContext.findModule(baseLeafRefType.getQName().getModule()).orElse(null); }
@Override public boolean requireInstance() { return baseType().requireInstance(); }
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); } }
private Module getBaseTypeModule(final LeafrefTypeDefinition leafrefType) { /* * Find the first definition of supplied leafref type and return the * module which contains this definition. */ LeafrefTypeDefinition baseLeafRefType = leafrefType; while (baseLeafRefType.getBaseType() != null) { baseLeafRefType = baseLeafRefType.getBaseType(); } return schemaContext.findModule(baseLeafRefType.getQName().getModule()).orElse(null); }
@Override public boolean requireInstance() { return baseType().requireInstance(); }
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); } }
static boolean equals(final @NonNull LeafrefTypeDefinition type, final @Nullable Object obj) { if (type == obj) { return true; } final LeafrefTypeDefinition other = TypeDefinitions.castIfEquals(LeafrefTypeDefinition.class, type, obj); return other != null && type.getPathStatement().equals(other.getPathStatement()); }
static int hashCode(final @NonNull LeafrefTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getPathStatement()); }
@Override LeafrefTypeDefinition buildType() { final LeafrefTypeDefinition base = getBaseType(); if (getRequireInstance() == base.requireInstance()) { return base; } return new RestrictedLeafrefType(getBaseType(), getPath(), getUnknownSchemaNodes(), getRequireInstance()); } };
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); }
@Override public RevisionAwareXPath getPathStatement() { return getBaseType().getPathStatement(); }
@Override LeafrefTypeDefinition buildType() { final LeafrefTypeDefinition base = getBaseType(); if (getRequireInstance() == base.requireInstance()) { return base; } return new RestrictedLeafrefType(getBaseType(), getPath(), getUnknownSchemaNodes(), getRequireInstance()); } };
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); }
@Override public RevisionAwareXPath getPathStatement() { return baseType().getPathStatement(); }
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); }
@Override public RevisionAwareXPath getPathStatement() { return getBaseType().getPathStatement(); }
@Override public boolean equals(final Object obj) { return LeafrefTypeDefinition.equals(this, obj); }