From: Robert Varga Date: Thu, 28 Jul 2016 02:35:03 +0000 (+0200) Subject: BUG-865: remove deprecated EnumPairImpl X-Git-Tag: release/boron~31 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=43032393dc77de6c669e0140e3fb19a05c7efc39;p=yangtools.git BUG-865: remove deprecated EnumPairImpl With all users migrated, this class can safely be removed. Change-Id: I939ed0b1d127dabadd45134a83d50a7d3073ac74 Signed-off-by: Robert Varga --- diff --git a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/EnumPairImpl.java b/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/EnumPairImpl.java deleted file mode 100644 index 5716ddd5cb..0000000000 --- a/yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/EnumPairImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2015 Pantheon Technologies s.r.o. 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.yang.model.util; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import org.opendaylight.yangtools.concepts.Immutable; -import org.opendaylight.yangtools.yang.model.api.SchemaPath; -import org.opendaylight.yangtools.yang.model.api.Status; -import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode; -import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition.EnumPair; - -/** - * @deprecated use {@link org.opendaylight.yangtools.yang.model.util.type.EnumPairBuilder} instead. - */ -@Deprecated -public final class EnumPairImpl implements EnumPair, Immutable { - private final List unknownSchemaNodes; - private final String description; - private final String reference; - private final Status status; - private final Integer value; - private final String name; - - public EnumPairImpl(final String name, final Integer value, final SchemaPath path, final String description, - final String reference, final Status status, final Collection unknownSchemaNodes) { - this(name, value, description, reference, status, unknownSchemaNodes); - } - - public EnumPairImpl(final String name, final Integer value, final String description, final String reference, - final Status status, final Collection unknownSchemaNodes) { - this.value = Preconditions.checkNotNull(value); - this.name = Preconditions.checkNotNull(name); - this.description = description; - this.reference = reference; - this.status = Preconditions.checkNotNull(status); - this.unknownSchemaNodes = ImmutableList.copyOf(unknownSchemaNodes); - } - - @Override - public List getUnknownSchemaNodes() { - return unknownSchemaNodes; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public String getReference() { - return reference; - } - - @Override - public Status getStatus() { - return status; - } - - @Override - public String getName() { - return name; - } - - @Override - public Integer getValue() { - return value; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + Objects.hashCode(unknownSchemaNodes); - result = prime * result + Objects.hashCode(name); - result = prime * result + Objects.hashCode(value); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof EnumPair)) { - return false; - } - EnumPair other = (EnumPair) obj; - if (!Objects.equals(name, other.getName())) { - return false; - } - - return Objects.equals(value, other.getValue()) && - Objects.equals(unknownSchemaNodes, other.getUnknownSchemaNodes()); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this).add("name", name).add("value", value).toString(); - } -}