Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java
41171 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.print.attribute.standard;2627import java.io.Serial;2829import javax.print.attribute.Attribute;30import javax.print.attribute.EnumSyntax;31import javax.print.attribute.PrintJobAttribute;32import javax.print.attribute.PrintRequestAttribute;3334/**35* Class {@code Fidelity} is a printing attribute class, an enumeration, that36* indicates whether total fidelity to client supplied print request attributes37* is required. If {@code FIDELITY_TRUE} is specified and a service cannot print38* the job exactly as specified it must reject the job. If39* {@code FIDELITY_FALSE} is specified a reasonable attempt to print the job is40* acceptable. If not supplied the default is {@code FIDELITY_FALSE}.41* <p>42* <b>IPP Compatibility:</b> The IPP boolean value is "true" for43* {@code FIDELITY_TRUE} and "false" for {@code FIDELITY_FALSE}. The category44* name returned by {@code getName()} is the IPP attribute name. The45* enumeration's integer value is the IPP enum value. The {@code toString()}46* method returns the IPP string representation of the attribute value. See47* <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for a48* fuller description of the IPP fidelity attribute.49*/50public final class Fidelity extends EnumSyntax51implements PrintJobAttribute, PrintRequestAttribute {5253/**54* Use serialVersionUID from JDK 1.4 for interoperability.55*/56@Serial57private static final long serialVersionUID = 6320827847329172308L;5859/**60* The job must be printed exactly as specified. or else rejected.61*/62public static final Fidelity63FIDELITY_TRUE = new Fidelity(0);6465/**66* The printer should make reasonable attempts to print the job, even if it67* cannot print it exactly as specified.68*/69public static final Fidelity70FIDELITY_FALSE = new Fidelity(1);7172/**73* Construct a new fidelity enumeration value with the given integer value.74*75* @param value Integer value76*/77protected Fidelity(int value) {78super (value);79}8081/**82* The string table for class {@code Fidelity}.83*/84private static final String[] myStringTable = {85"true",86"false"87};8889/**90* The enumeration value table for class {@code Fidelity}.91*/92private static final Fidelity[] myEnumValueTable = {93FIDELITY_TRUE,94FIDELITY_FALSE95};9697/**98* Returns the string table for class {@code Fidelity}.99*/100protected String[] getStringTable() {101return myStringTable;102}103104/**105* Returns the enumeration value table for class {@code Fidelity}.106*/107protected EnumSyntax[] getEnumValueTable() {108return myEnumValueTable;109}110111/**112* Get the printing attribute class which is to be used as the "category"113* for this printing attribute value.114* <p>115* For class {@code Fidelity} the category is class116* {@code Fidelity} itself.117*118* @return printing attribute class (category), an instance of class119* {@link Class java.lang.Class}120*/121public final Class<? extends Attribute> getCategory() {122return Fidelity.class;123}124125/**126* Get the name of the category of which this attribute value is an127* instance.128* <p>129* For class {@code Fidelity} the category name is130* {@code "ipp-attribute-fidelity"}.131*132* @return attribute category name133*/134public final String getName() {135return "ipp-attribute-fidelity";136}137}138139140