2 * Copyright (c) 2014 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.yangtools.binding.data.codec.gen.spi;
10 import com.google.common.base.Preconditions;
14 * Definition of static property for generated class
16 * This definition consists of
18 * <li>name - property name</li>
19 * <li>type - Java type for property</li>
20 * <li>value - value to which property should be initialized</li>
23 public class StaticConstantDefinition {
25 private final String name;
26 private final Class<?> type;
27 private final Object value;
29 public StaticConstantDefinition(final String name, final Class<?> type, final Object value) {
31 this.name = Preconditions.checkNotNull(name);
32 this.type = Preconditions.checkNotNull(type);
33 this.value = Preconditions.checkNotNull(value);
36 public String getName() {
40 public Class<?> getType() {
44 public Object getValue() {
49 public int hashCode() {
52 result = prime * result + name.hashCode();
57 public boolean equals(final Object obj) {
64 if (getClass() != obj.getClass()) {
67 StaticConstantDefinition other = (StaticConstantDefinition) obj;
68 if (!name.equals(other.name)) {