FileDocCategorySizeDatePackage
PrinterId.javaAPI DocAndroid 5.1 API3820Thu Mar 12 22:22:10 GMT 2015android.print

PrinterId

public final class PrinterId extends Object implements android.os.Parcelable
This class represents the unique id of a printer.

Fields Summary
private final android.content.ComponentName
mServiceName
private final String
mLocalId
public static final Parcelable.Creator
CREATOR
Constructors Summary
public PrinterId(android.content.ComponentName serviceName, String localId)
Creates a new instance.

param
serviceName The managing print service.
param
localId The locally unique id within the managing service.
hide

        mServiceName = serviceName;
        mLocalId = localId;
    
private PrinterId(android.os.Parcel parcel)

        mServiceName = parcel.readParcelable(null);
        mLocalId = parcel.readString();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleanequals(java.lang.Object object)

        if (this == object) {
            return true;
        }
        if (object == null) {
            return false;
        }
        if (getClass() != object.getClass()) {
            return false;
        }
        PrinterId other = (PrinterId) object;
        if (mServiceName == null) {
            if (other.mServiceName != null) {
                return false;
            }
        } else if (!mServiceName.equals(other.mServiceName)) {
            return false;
        }
        if (!TextUtils.equals(mLocalId, other.mLocalId)) {
            return false;
        }
        return true;
    
public java.lang.StringgetLocalId()
Gets the id of this printer which is unique in the context of the print service that manages it.

return
The printer name.

        return mLocalId;
    
public android.content.ComponentNamegetServiceName()
The id of the print service this printer is managed by.

return
The print service component name.
hide

        return mServiceName;
    
public inthashCode()

        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((mServiceName != null)
                ? mServiceName.hashCode() : 1);
        hashCode = prime * hashCode + mLocalId.hashCode();
        return hashCode;
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder();
        builder.append("PrinterId{");
        builder.append("serviceName=").append(mServiceName.flattenToString());
        builder.append(", localId=").append(mLocalId);
        builder.append('}");
        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel parcel, int flags)

        parcel.writeParcelable(mServiceName, flags);
        parcel.writeString(mLocalId);