import org.opendaylight.yangtools.sal.binding.model.api.GeneratedTransferObject
import org.opendaylight.yangtools.sal.binding.model.api.GeneratedType
import org.opendaylight.yangtools.sal.binding.model.api.Restrictions
+import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition
import com.google.common.base.Preconditions
/**
«ENDIF»
«ENDFOR»
+ «IF (genTO.isTypedef() && genTO.getBaseType instanceof BitsTypeDefinition)»
+ «generateGetValueForBitsTypeDef»
+ «ENDIF»
+
«generateHashCode»
«generateEquals»
«generateRangeMethod("range", "_range")»
}
+
+ '''
+
+ /**
+ * Template method which generates the method <code>getValue()</code> for typedef,
+ * which base type is BitsDefinition.
+ *
+ * @return string with the <code>getValue()</code> method definition in JAVA format
+ */
+ def protected generateGetValueForBitsTypeDef() '''
+
+ public boolean[] getValue() {
+ return new boolean[]{
+ «FOR property: genTO.properties SEPARATOR ','»
+ «property.fieldName»
+ «ENDFOR»
+ };
+ }
'''
def private generateLengthMethod(String methodName, String varName) '''