@Override public ArrayType<?> getOpenType() { OpenType<?> innerOpenType = innerAttribute.getOpenType(); return constructArrayType(innerOpenType); }
private OpenType<?> getArrayType() { String innerTypeFullyQName = getInnerType(getType()); SimpleType<?> innerSimpleType = SimpleTypeResolver.getSimpleType(innerTypeFullyQName); return getArrayOpenTypeForSimpleType(innerTypeFullyQName, innerSimpleType); }
@Override public String toString() { return "TOAttribute{" + getAttributeYangName() + "," + "to=" + yangNameToAttributeMap + '}'; }
public AttributeMappingStrategy<?, ? extends OpenType<?>> prepareStrategy(AttributeIfc attributeIfc) { if(attributeIfc instanceof DependencyAttribute) { namespaceOfDepAttr = ((DependencyAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString(); } else if (attributeIfc instanceof ListDependenciesAttribute) { namespaceOfDepAttr = ((ListDependenciesAttribute)attributeIfc).getDependency().getSie().getQName().getNamespace().toString(); } return switchAttribute(attributeIfc); }
@Override protected AttributeReadingStrategy caseListAttribute(ArrayType<?> openType) { AttributeIfc lastAttribute = getLastAttribute(); Preconditions.checkState(lastAttribute instanceof ListAttribute); AttributeReadingStrategy innerStrategy = prepareReadingStrategy(key, ((ListAttribute) lastAttribute).getInnerAttribute()); return new ArrayAttributeReadingStrategy(lastAttribute.getNullableDefault(), innerStrategy); }
boolean isVoid() { return returnType == VoidAttribute.getInstance(); }
private static AttributeIfc getReturnTypeAttribute(final DataSchemaNode child, final TypeProviderWrapper typeProviderWrapper, final String packageName) { if (child instanceof LeafSchemaNode) { LeafSchemaNode leaf = (LeafSchemaNode) child; return new JavaAttribute(leaf, typeProviderWrapper); } else if (child instanceof ContainerSchemaNode) { ContainerSchemaNode container = (ContainerSchemaNode) child; TOAttribute toAttribute = TOAttribute.create(container, typeProviderWrapper, packageName); return toAttribute; } else if (child instanceof ListSchemaNode) { return ListAttribute.create((ListSchemaNode) child, typeProviderWrapper, packageName); } else if (child instanceof LeafListSchemaNode) { return ListAttribute.create((LeafListSchemaNode) child, typeProviderWrapper); } else { throw new IllegalStateException("Unknown output data node " + child + " for rpc"); } }
private static boolean needsDepResolver(final AttributeIfc value) { if(value instanceof TOAttribute) { return true; } if(value instanceof ListAttribute) { AttributeIfc innerAttribute = ((ListAttribute) value).getInnerAttribute(); return needsDepResolver(innerAttribute); } return false; }
@Override public String toString() { return "JavaAttribute{" + getAttributeYangName() + "," + "type=" + type + '}'; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (dependency != null ? dependency.hashCode() : 0); result = 31 * result + (nullableDescription != null ? nullableDescription.hashCode() : 0); result = 31 * result + (nullableDefault != null ? nullableDefault.hashCode() : 0); return result; }
public static ListAttribute create(LeafListSchemaNode node, TypeProviderWrapper typeProvider) { JavaAttribute innerAttribute = new JavaAttribute(node, typeProvider); return new ListAttribute(node, innerAttribute, node.getDescription()); }
public static ListAttribute create(ListSchemaNode node, TypeProviderWrapper typeProvider, String packageName) { TOAttribute innerAttribute = TOAttribute.create(node, typeProvider, packageName); return new ListAttribute(node, innerAttribute, node.getDescription()); }
private void addArtificialPropertyToUnionCompositeType(final TypeDefinition<?> baseTypeDefinition, final String[] itemNames, final OpenType<?>[] itemTypes) { String artificialPropertyName = typeProviderWrapper.getJMXParamForBaseType(baseTypeDefinition); itemNames[0] = artificialPropertyName; OpenType<?> artificialPropertyType = getArrayOpenTypeForSimpleType(TYPE_OF_ARTIFICIAL_UNION_PROPERTY.getName(), SimpleTypeResolver.getSimpleType(TYPE_OF_ARTIFICIAL_UNION_PROPERTY.getName())); itemTypes[0] = artificialPropertyType; }
public boolean isUnion() { TypeDefinition<?> base = getBaseType(typeProviderWrapper, typeDefinition); return base instanceof UnionTypeDefinition; }
private OpenType<?> getSimpleType(final Type type) { SimpleType<?> simpleType = SimpleTypeResolver.getSimpleType(type); return simpleType; }
@Override public String toString() { return "ListAttribute{" + getAttributeYangName() + "," + "to=" + innerAttribute + '}'; }
@Override public ArrayType<?> getOpenType() { OpenType<?> innerOpenType = SimpleType.OBJECTNAME; return ListAttribute.constructArrayType(innerOpenType); }
public AbstractDependencyAttribute(DataSchemaNode attrNode, ServiceInterfaceEntry sie, boolean mandatory, String nullableDescription) { super(attrNode); dependency = new Dependency(sie, mandatory); this.nullableDescription = nullableDescription; nullableDefault = null; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (nullableDescription != null ? nullableDescription.hashCode() : 0); result = 31 * result + (nullableDefault != null ? nullableDefault.hashCode() : 0); return result; }
public boolean isEnum() { TypeDefinition<?> base = getBaseType(typeProviderWrapper, typeDefinition); return base instanceof EnumTypeDefinition; }