Static methods are implicitly final, no need to declare them as final.
Change-Id: Ia3b085ce0e4cde46952d1b4afc6c908fdec4a506
Signed-off-by: Robert Varga <rovarga@cisco.com>
* @param version data node version
* @return new AbstractTreeNode instance, covering the data tree provided
*/
- public static final TreeNode createTreeNodeRecursively(final NormalizedNode<?, ?> data, final Version version) {
+ public static TreeNode createTreeNodeRecursively(final NormalizedNode<?, ?> data, final Version version) {
if (data instanceof NormalizedNodeContainer<?, ?, ?>) {
@SuppressWarnings("unchecked")
NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>> container = (NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>>) data;
* @param version data node version
* @return new AbstractTreeNode instance, covering the data tree provided
*/
- public static final TreeNode createTreeNode(final NormalizedNode<?, ?> data, final Version version) {
+ public static TreeNode createTreeNode(final NormalizedNode<?, ?> data, final Version version) {
if (data instanceof NormalizedNodeContainer<?, ?, ?>) {
@SuppressWarnings("unchecked")
NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>> container = (NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>>) data;
}
- private final void validate(final N value) {
+ private void validate(final N value) {
if (rangeConstraints.isEmpty()) {
return;
}
return type.getRangeConstraints();
}
- private static final int provideBase(final String integer) {
+ private static int provideBase(final String integer) {
if (integer == null) {
throw new IllegalArgumentException("String representing integer number cannot be NULL");
}
import org.w3c.dom.Element;
public final class XmlDocumentUtils {
+ public static final QName OPERATION_ATTRIBUTE_QNAME = QName.create(SchemaContext.NAME, "operation");
+ private static final Logger LOG = LoggerFactory.getLogger(XmlDocumentUtils.class);
private XmlDocumentUtils() {
throw new UnsupportedOperationException("Utility class should not be instantiated");
}
- public static final QName OPERATION_ATTRIBUTE_QNAME = QName.create(SchemaContext.NAME, "operation");
- private static final Logger LOG = LoggerFactory.getLogger(XmlDocumentUtils.class);
-
public static Document getDocument() {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
Document doc = null;
return doc;
}
- private static final Element createElementFor(final Document doc, final QName qname, final Object obj) {
+ private static Element createElementFor(final Document doc, final QName qname, final Object obj) {
final Element ret;
if (qname.getNamespace() != null) {
ret = doc.createElementNS(qname.getNamespace().toString(), qname.getLocalName());
return QName.create(namespace != null ? URI.create(namespace) : null, null, localName);
}
-
-
public static Optional<ModifyAction> getModifyOperationFromAttributes(final Element xmlElement) {
Attr attributeNodeNS = xmlElement.getAttributeNodeNS(OPERATION_ATTRIBUTE_QNAME.getNamespace().toString(), OPERATION_ATTRIBUTE_QNAME.getLocalName());
if(attributeNodeNS == null) {
return Optional.of(action);
}
-
- public static final Optional<DataSchemaNode> findFirstSchema(final QName qname, final Iterable<DataSchemaNode> dataSchemaNode) {
+ public static Optional<DataSchemaNode> findFirstSchema(final QName qname, final Iterable<DataSchemaNode> dataSchemaNode) {
if (dataSchemaNode != null && qname != null) {
for (DataSchemaNode dsn : dataSchemaNode) {
if (qname.isEqualWithoutRevision(dsn.getQName())) {
return Optional.absent();
}
- public static final XmlCodecProvider defaultValueCodecProvider() {
+ public static XmlCodecProvider defaultValueCodecProvider() {
return XmlUtils.DEFAULT_XML_CODEC_PROVIDER;
}
}
this.namespaceDefinitions = namespaces;
}
- public static final Builder builder() {
+ public static Builder builder() {
return new Builder(EMPTY);
}
- public static final Builder derivedFrom(StatementSupportBundle parent) {
+ public static Builder derivedFrom(StatementSupportBundle parent) {
return new Builder(parent);
}
public final class StmtContextUtils {
private static final Function<StmtContext<?, ?,?>, DeclaredStatement<?>> BUILD_DECLARED = new Function<StmtContext<?,?,?>, DeclaredStatement<?>>() {
-
@Override
public DeclaredStatement<?> apply(StmtContext<?,?,?> input) {
return input.buildDeclared();
}
-
};
private static final Function<StmtContext<?, ?,?>, EffectiveStatement<?,?>> BUILD_EFFECTIVE = new Function<StmtContext<?,?,?>, EffectiveStatement<?,?>>() {
-
@Override
public EffectiveStatement<?,?> apply(StmtContext<?,?,?> input) {
return input.buildEffective();
}
-
};
private StmtContextUtils() {
throw new UnsupportedOperationException("Utility class");
}
-
@SuppressWarnings("unchecked")
- public static final <D extends DeclaredStatement<?>> Function<StmtContext<?, ? extends D, ?>, D> buildDeclared() {
+ public static <D extends DeclaredStatement<?>> Function<StmtContext<?, ? extends D, ?>, D> buildDeclared() {
return Function.class.cast(BUILD_DECLARED);
}
@SuppressWarnings("unchecked")
- public static final <E extends EffectiveStatement<?,?>> Function<StmtContext<?, ?,? extends E>, E> buildEffective() {
+ public static <E extends EffectiveStatement<?,?>> Function<StmtContext<?, ?,? extends E>, E> buildEffective() {
return Function.class.cast(BUILD_EFFECTIVE);
}
@SuppressWarnings("unchecked")
- public static final <AT,DT extends DeclaredStatement<AT>> AT firstAttributeOf(Iterable<? extends StmtContext<?,?,?>> contexts, Class<DT> declaredType) {
+ public static <AT,DT extends DeclaredStatement<AT>> AT firstAttributeOf(Iterable<? extends StmtContext<?,?,?>> contexts, Class<DT> declaredType) {
for(StmtContext<?, ?, ?> ctx : contexts) {
if(producesDeclared(ctx,declaredType)) {
return (AT) ctx.getStatementArgument();
return null;
}
- public static final boolean producesDeclared(StmtContext<?, ?, ?> ctx, Class<? extends DeclaredStatement<?>> type) {
+ public static boolean producesDeclared(StmtContext<?, ?, ?> ctx, Class<? extends DeclaredStatement<?>> type) {
return type.isAssignableFrom(ctx.getPublicDefinition().getDeclaredRepresentationClass());
}
-
-
-
}
super(provider, YangTextSchemaSource.class, consumer, ASTSchemaSource.class, TRANSFORMATION);
}
- public static final TextToASTTransformer create(final SchemaRepository provider, final SchemaSourceRegistry consumer) {
+ public static TextToASTTransformer create(final SchemaRepository provider, final SchemaSourceRegistry consumer) {
return new TextToASTTransformer(provider, consumer);
}
}