Path: blob/master/src/java.management/share/classes/javax/management/BooleanValueExp.java
41155 views
/*1* Copyright (c) 1999, 2013, 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.management;262728/**29* This class represents a boolean value. A BooleanValueExp may be30* used anywhere a ValueExp is required.31* @serial include32*33* @since 1.534*/35class BooleanValueExp extends QueryEval implements ValueExp {3637/* Serial version */38private static final long serialVersionUID = 7754922052666594581L;3940/**41* @serial The boolean value42*/43private boolean val = false;444546/** Creates a new BooleanValueExp representing the boolean literal {@code val}.*/47BooleanValueExp(boolean val) {48this.val = val;49}5051/**Creates a new BooleanValueExp representing the Boolean object {@code val}.*/52BooleanValueExp(Boolean val) {53this.val = val.booleanValue();54}555657/** Returns the Boolean object representing the value of the BooleanValueExp object.*/58public Boolean getValue() {59return Boolean.valueOf(val);60}6162/**63* Returns the string representing the object.64*/65public String toString() {66return String.valueOf(val);67}6869/**70* Applies the ValueExp on a MBean.71*72* @param name The name of the MBean on which the ValueExp will be applied.73*74* @return The <CODE>ValueExp</CODE>.75*76* @exception BadStringOperationException77* @exception BadBinaryOpValueExpException78* @exception BadAttributeValueExpException79* @exception InvalidApplicationException80*/81public ValueExp apply(ObjectName name) throws BadStringOperationException, BadBinaryOpValueExpException,82BadAttributeValueExpException, InvalidApplicationException {83return this;84}8586@Deprecated87public void setMBeanServer(MBeanServer s) {88super.setMBeanServer(s);89}909192}939495