FileDocCategorySizeDatePackage
NameValuePair.javaAPI DocAndroid 5.1 API2692Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.annotation

NameValuePair

public final class NameValuePair extends Object implements Comparable
A (name, value) pair. These are used as the contents of an annotation.

Fields Summary
private final com.android.dx.rop.cst.CstString
name
{@code non-null;} the name
private final com.android.dx.rop.cst.Constant
value
{@code non-null;} the value
Constructors Summary
public NameValuePair(com.android.dx.rop.cst.CstString name, com.android.dx.rop.cst.Constant value)
Construct an instance.

param
name {@code non-null;} the name
param
value {@code non-null;} the value

        if (name == null) {
            throw new NullPointerException("name == null");
        }

        if (value == null) {
            throw new NullPointerException("value == null");
        }

        this.name = name;
        this.value = value;
    
Methods Summary
public intcompareTo(com.android.dx.rop.annotation.NameValuePair other)
{@inheritDoc}

Instances of this class compare in name-major and value-minor order.

        int result = name.compareTo(other.name);

        if (result != 0) {
            return result;
        }

        return value.compareTo(other.value);
    
public booleanequals(java.lang.Object other)
{@inheritDoc}

        if (! (other instanceof NameValuePair)) {
            return false;
        }

        NameValuePair otherPair = (NameValuePair) other;

        return name.equals(otherPair.name)
            && value.equals(otherPair.value);
    
public com.android.dx.rop.cst.CstStringgetName()
Gets the name.

return
{@code non-null;} the name

        return name;
    
public com.android.dx.rop.cst.ConstantgetValue()
Gets the value.

return
{@code non-null;} the value

        return value;
    
public inthashCode()
{@inheritDoc}

        return name.hashCode() * 31 + value.hashCode();
    
public java.lang.StringtoString()
{@inheritDoc}

        return name.toHuman() + ":" + value;