33 /** 34 * Class PrinterMessageFromOperator is a printing attribute class, a text 35 * attribute, that provides a message from an operator, system administrator, 36 * or "intelligent" process to indicate to the end user information about or 37 * status of the printer, such as why it is unavailable or when it is 38 * expected to be available. 39 * <P> 40 * A Print Service's attribute set includes zero instances or one instance of 41 * a 42 * PrinterMessageFromOperator attribute, not more than one instance. A new 43 * PrinterMessageFromOperator attribute replaces an existing 44 * PrinterMessageFromOperator attribute, if any. In other words, 45 * PrinterMessageFromOperator is not intended to be a history log. 46 * If it wishes, the client can detect changes to a Print Service's 47 * PrinterMessageFromOperator 48 * attribute and maintain the client's own history log of the 49 * PrinterMessageFromOperator attribute values. 50 * <P> 51 * <B>IPP Compatibility:</B> The string value gives the IPP name value. The 52 * locale gives the IPP natural language. The category name returned by 53 * <CODE>getName()</CODE> gives the IPP attribute name. 54 * 55 * @author Alan Kaminsky 56 */ 57 public final class PrinterMessageFromOperator extends TextSyntax 58 implements PrintServiceAttribute { 59 60 static final long serialVersionUID = -4486871203218629318L; 61 62 /** 63 * Constructs a new printer message from operator attribute with the 64 * given message and locale. 65 * 66 * @param message Message. 67 * @param locale Natural language of the text string. null 68 * is interpreted to mean the default locale as returned 69 * by <code>Locale.getDefault()</code> 70 * 71 * @exception NullPointerException 72 * (unchecked exception) Thrown if <CODE>message</CODE> is null. 73 */ 74 public PrinterMessageFromOperator(String message, Locale locale) { 75 super (message, locale); 76 } 77 78 /** 79 * Returns whether this printer message from operator attribute is 80 * equivalent to the passed in object. To be equivalent, all of the 81 * following conditions must be true: 82 * <OL TYPE=1> 83 * <LI> 84 * <CODE>object</CODE> is not null. 85 * <LI> 86 * <CODE>object</CODE> is an instance of class 87 * PrinterMessageFromOperator. 88 * <LI> 89 * This printer message from operator attribute's underlying string and 90 * <CODE>object</CODE>'s underlying string are equal. 91 * <LI> 92 * This printer message from operator attribute's locale and 93 * <CODE>object</CODE>'s locale are equal. 94 * </OL> 95 * 96 * @param object Object to compare to. 97 * 98 * @return True if <CODE>object</CODE> is equivalent to this printer 99 * message from operator attribute, false otherwise. 100 */ 101 public boolean equals(Object object) { 102 return (super.equals(object) && 103 object instanceof PrinterMessageFromOperator); 104 } 105 106 /** 107 * Get the printing attribute class which is to be used as the "category" 108 * for this printing attribute value. 109 * <P> 110 * For class PrinterMessageFromOperator, 111 * the category is class PrinterMessageFromOperator itself. 112 * 113 * @return Printing attribute class (category), an instance of class 114 * {@link java.lang.Class java.lang.Class}. 115 */ 116 public final Class<? extends Attribute> getCategory() { 117 return PrinterMessageFromOperator.class; 118 } 119 120 /** 121 * Get the name of the category of which this attribute value is an 122 * instance. 123 * <P> 124 * For class PrinterMessageFromOperator, 125 * the category name is <CODE>"printer-message-from-operator"</CODE>. 126 * 127 * @return Attribute category name. 128 */ 129 public final String getName() { 130 return "printer-message-from-operator"; 131 } 132 133 } | 33 /** 34 * Class PrinterMessageFromOperator is a printing attribute class, a text 35 * attribute, that provides a message from an operator, system administrator, 36 * or "intelligent" process to indicate to the end user information about or 37 * status of the printer, such as why it is unavailable or when it is 38 * expected to be available. 39 * <P> 40 * A Print Service's attribute set includes zero instances or one instance of 41 * a 42 * PrinterMessageFromOperator attribute, not more than one instance. A new 43 * PrinterMessageFromOperator attribute replaces an existing 44 * PrinterMessageFromOperator attribute, if any. In other words, 45 * PrinterMessageFromOperator is not intended to be a history log. 46 * If it wishes, the client can detect changes to a Print Service's 47 * PrinterMessageFromOperator 48 * attribute and maintain the client's own history log of the 49 * PrinterMessageFromOperator attribute values. 50 * <P> 51 * <B>IPP Compatibility:</B> The string value gives the IPP name value. The 52 * locale gives the IPP natural language. The category name returned by 53 * {@code getName()} gives the IPP attribute name. 54 * 55 * @author Alan Kaminsky 56 */ 57 public final class PrinterMessageFromOperator extends TextSyntax 58 implements PrintServiceAttribute { 59 60 static final long serialVersionUID = -4486871203218629318L; 61 62 /** 63 * Constructs a new printer message from operator attribute with the 64 * given message and locale. 65 * 66 * @param message Message. 67 * @param locale Natural language of the text string. null 68 * is interpreted to mean the default locale as returned 69 * by {@code Locale.getDefault()} 70 * 71 * @exception NullPointerException 72 * (unchecked exception) Thrown if {@code message} is null. 73 */ 74 public PrinterMessageFromOperator(String message, Locale locale) { 75 super (message, locale); 76 } 77 78 /** 79 * Returns whether this printer message from operator attribute is 80 * equivalent to the passed in object. To be equivalent, all of the 81 * following conditions must be true: 82 * <OL TYPE=1> 83 * <LI> 84 * {@code object} is not null. 85 * <LI> 86 * {@code object} is an instance of class 87 * PrinterMessageFromOperator. 88 * <LI> 89 * This printer message from operator attribute's underlying string and 90 * {@code object}'s underlying string are equal. 91 * <LI> 92 * This printer message from operator attribute's locale and 93 * {@code object}'s locale are equal. 94 * </OL> 95 * 96 * @param object Object to compare to. 97 * 98 * @return True if {@code object} is equivalent to this printer 99 * message from operator attribute, false otherwise. 100 */ 101 public boolean equals(Object object) { 102 return (super.equals(object) && 103 object instanceof PrinterMessageFromOperator); 104 } 105 106 /** 107 * Get the printing attribute class which is to be used as the "category" 108 * for this printing attribute value. 109 * <P> 110 * For class PrinterMessageFromOperator, 111 * the category is class PrinterMessageFromOperator itself. 112 * 113 * @return Printing attribute class (category), an instance of class 114 * {@link java.lang.Class java.lang.Class}. 115 */ 116 public final Class<? extends Attribute> getCategory() { 117 return PrinterMessageFromOperator.class; 118 } 119 120 /** 121 * Get the name of the category of which this attribute value is an 122 * instance. 123 * <P> 124 * For class PrinterMessageFromOperator, 125 * the category name is {@code "printer-message-from-operator"}. 126 * 127 * @return Attribute category name. 128 */ 129 public final String getName() { 130 return "printer-message-from-operator"; 131 } 132 133 } |