-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.binding.generator.util.generated.type.builder;
-
-
-import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier;
-import org.opendaylight.yangtools.sal.binding.model.api.AnnotationType;
-import org.opendaylight.yangtools.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.sal.binding.model.api.TypeMember;
-
-import java.util.Collections;
-import java.util.List;
-
-abstract class AbstractTypeMember implements TypeMember {
-
- private final String name;
- private final String comment;
- private final Type definingType;
- private final Type returnType;
- private final List<AnnotationType> annotations;
- private final boolean isFinal;
- private final AccessModifier accessModifier;
-
- public AbstractTypeMember(final Type definingType, final String name, final List<AnnotationType> annotations,
- final String comment, final AccessModifier accessModifier, final Type returnType,
- boolean isFinal) {
- super();
- this.definingType = definingType;
- this.name = name;
- this.annotations = Collections.unmodifiableList(annotations);
- this.comment = comment;
- this.accessModifier = accessModifier;
- this.returnType = returnType;
- this.isFinal = isFinal;
- }
-
- @Override
- public List<AnnotationType> getAnnotations() {
- return annotations;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getComment() {
- return comment;
- }
-
- @Override
- public Type getDefiningType() {
- return definingType;
- }
-
- @Override
- public AccessModifier getAccessModifier() {
- return accessModifier;
- }
-
- @Override
- public Type getReturnType() {
- return returnType;
- }
-
- @Override
- public boolean isFinal() {
- return isFinal;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
- result = prime * result
- + ((getReturnType() == null) ? 0 : getReturnType().hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- MethodSignatureImpl other = (MethodSignatureImpl) obj;
- if (getName() == null) {
- if (other.getName() != null) {
- return false;
- }
- } else if (!getName().equals(other.getName())) {
- return false;
- }
- if (getReturnType() == null) {
- if (other.getReturnType() != null) {
- return false;
- }
- } else if (!getReturnType().equals(other.getReturnType())) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("MethodSignatureImpl [name=");
- builder.append(getName());
- builder.append(", comment=");
- builder.append(getComment());
- if (getDefiningType() != null) {
- builder.append(", definingType=");
- builder.append(getDefiningType().getPackageName());
- builder.append(".");
- builder.append(getDefiningType().getName());
- } else {
- builder.append(", definingType= null");
- }
- builder.append(", returnType=");
- builder.append(getReturnType());
- builder.append(", annotations=");
- builder.append(getAnnotations());
- builder.append("]");
- return builder.toString();
- }
-}
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.yangtools.binding.generator.util.generated.type.builder;\r
+\r
+\r
+import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier;\r
+import org.opendaylight.yangtools.sal.binding.model.api.AnnotationType;\r
+import org.opendaylight.yangtools.sal.binding.model.api.Type;\r
+import org.opendaylight.yangtools.sal.binding.model.api.TypeMember;\r
+\r
+import java.util.Collections;\r
+import java.util.List;\r
+\r
+abstract class AbstractTypeMember implements TypeMember {\r
+\r
+ private final String name;\r
+ private final String comment;\r
+ private final Type definingType;\r
+ private final Type returnType;\r
+ private final List<AnnotationType> annotations;\r
+ private final boolean isFinal;\r
+ private final AccessModifier accessModifier;\r
+\r
+ public AbstractTypeMember(final Type definingType, final String name, final List<AnnotationType> annotations,\r
+ final String comment, final AccessModifier accessModifier, final Type returnType,\r
+ boolean isFinal) {\r
+ super();\r
+ this.definingType = definingType;\r
+ this.name = name;\r
+ this.annotations = Collections.unmodifiableList(annotations);\r
+ this.comment = comment;\r
+ this.accessModifier = accessModifier;\r
+ this.returnType = returnType;\r
+ this.isFinal = isFinal;\r
+ }\r
+\r
+ @Override\r
+ public List<AnnotationType> getAnnotations() {\r
+ return annotations;\r
+ }\r
+\r
+ @Override\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ @Override\r
+ public String getComment() {\r
+ return comment;\r
+ }\r
+\r
+ @Override\r
+ public Type getDefiningType() {\r
+ return definingType;\r
+ }\r
+\r
+ @Override\r
+ public AccessModifier getAccessModifier() {\r
+ return accessModifier;\r
+ }\r
+\r
+ @Override\r
+ public Type getReturnType() {\r
+ return returnType;\r
+ }\r
+\r
+ @Override\r
+ public boolean isFinal() {\r
+ return isFinal;\r
+ }\r
+\r
+ @Override\r
+ public int hashCode() {\r
+ final int prime = 31;\r
+ int result = 1;\r
+ result = prime * result + ((getName() == null) ? 0 : getName().hashCode());\r
+ result = prime * result\r
+ + ((getReturnType() == null) ? 0 : getReturnType().hashCode());\r
+ return result;\r
+ }\r
+\r
+ @Override\r
+ public boolean equals(Object obj) {\r
+ if (this == obj) {\r
+ return true;\r
+ }\r
+ if (obj == null) {\r
+ return false;\r
+ }\r
+ if (getClass() != obj.getClass()) {\r
+ return false;\r
+ }\r
+ AbstractTypeMember other = (AbstractTypeMember) obj;\r
+ if (getName() == null) {\r
+ if (other.getName() != null) {\r
+ return false;\r
+ }\r
+ } else if (!getName().equals(other.getName())) {\r
+ return false;\r
+ }\r
+ if (getReturnType() == null) {\r
+ if (other.getReturnType() != null) {\r
+ return false;\r
+ }\r
+ } else if (!getReturnType().equals(other.getReturnType())) {\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ @Override\r
+ public String toString() {\r
+ StringBuilder builder = new StringBuilder();\r
+ builder.append("MethodSignatureImpl [name=");\r
+ builder.append(getName());\r
+ builder.append(", comment=");\r
+ builder.append(getComment());\r
+ if (getDefiningType() != null) {\r
+ builder.append(", definingType=");\r
+ builder.append(getDefiningType().getPackageName());\r
+ builder.append(".");\r
+ builder.append(getDefiningType().getName());\r
+ } else {\r
+ builder.append(", definingType= null");\r
+ }\r
+ builder.append(", returnType=");\r
+ builder.append(getReturnType());\r
+ builder.append(", annotations=");\r
+ builder.append(getAnnotations());\r
+ builder.append("]");\r
+ return builder.toString();\r
+ }\r
+}\r