2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.java.api.generator;
10 import static java.util.Objects.requireNonNull;
12 import java.util.List;
13 import org.opendaylight.mdsal.binding.model.api.AccessModifier;
14 import org.opendaylight.mdsal.binding.model.api.AnnotationType;
15 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
16 import org.opendaylight.mdsal.binding.model.api.MethodSignature;
17 import org.opendaylight.mdsal.binding.model.api.MethodSignature.ValueMechanics;
18 import org.opendaylight.mdsal.binding.model.api.Type;
20 final class BuilderGeneratedProperty implements GeneratedProperty {
21 private final MethodSignature method;
22 private final String name;
24 BuilderGeneratedProperty(final String name, final MethodSignature method) {
25 this.name = requireNonNull(name);
26 this.method = requireNonNull(method);
30 public String getName() {
35 public Type getReturnType() {
36 return method.getReturnType();
39 ValueMechanics getMechanics() {
40 return method.getMechanics();
44 public int hashCode() {
45 return name.hashCode();
49 public boolean equals(final Object obj) {
53 if (!(obj instanceof BuilderGeneratedProperty)) {
56 final BuilderGeneratedProperty other = (BuilderGeneratedProperty) obj;
57 return name.equals(other.name) && method.equals(other.method);
61 public String getComment() {
66 public List<AnnotationType> getAnnotations() {
71 public AccessModifier getAccessModifier() {
76 public boolean isStatic() {
81 public boolean isFinal() {
86 public Type getDefiningType() {
91 public String getValue() {
96 public boolean isReadOnly() {
100 private static UnsupportedOperationException uoe() {
101 return new UnsupportedOperationException("Method not supported");