2 * Copyright (c) 2013 Cisco Systems, Inc. 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.model.ri.generated.type.builder;
10 import java.util.Objects;
11 import org.opendaylight.mdsal.binding.model.api.Constant;
12 import org.opendaylight.mdsal.binding.model.api.Type;
14 final class ConstantImpl implements Constant {
15 private final Type type;
16 private final String name;
17 private final Object value;
19 ConstantImpl(final Type type, final String name, final Object value) {
26 public Type getType() {
31 public String getName() {
36 public Object getValue() {
41 public int hashCode() {
44 result = prime * result + Objects.hashCode(this.name);
45 result = prime * result + Objects.hashCode(this.type);
50 public boolean equals(final Object obj) {
54 if (obj == null || getClass() != obj.getClass()) {
57 final ConstantImpl other = (ConstantImpl) obj;
58 return Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type)
59 && Objects.equals(this.value, other.value);
63 public String toString() {
64 final StringBuilder builder = new StringBuilder();
65 builder.append("Constant [type=");
66 builder.append(this.type);
67 builder.append(", name=");
68 builder.append(this.name);
69 builder.append(", value=");
70 builder.append(this.value);
72 return builder.toString();