Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.4.0)

E90870-01

coherence/lang/Boolean.hpp

00001 /*
00002 * Boolean.hpp
00003 *
00004 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_BOOLEAN_HPP
00017 #define COH_BOOLEAN_HPP
00018 
00019 #include "coherence/lang/compatibility.hpp"
00020 
00021 #include "coherence/lang/cloneable_spec.hpp"
00022 #include "coherence/lang/Primitive.hpp"
00023 #include "coherence/lang/String.hpp"
00024 #include "coherence/lang/TypedHandle.hpp"
00025 
00026 COH_OPEN_NAMESPACE2(coherence,lang)
00027 
00028 
00029 /**
00030 * An immutable boolean value.
00031 *
00032 * @author jh  2008.04.01
00033 */
00034 class COH_EXPORT Boolean
00035     : public cloneable_spec<Boolean,
00036         extends<Primitive<bool> > >
00037     {
00038     friend class factory<Boolean>;
00039 
00040     // ----- constructors ---------------------------------------------------
00041 
00042     private:
00043         /**
00044         * @internal
00045         */
00046         Boolean(bool f);
00047 
00048         /**
00049         * Copy constructor.
00050         */
00051         Boolean(const Boolean& that);
00052 
00053 
00054     // ----- static methods -------------------------------------------------
00055 
00056     public:
00057         /**
00058         * Get an instance of a Boolean that represents true or false.
00059         *
00060         * @param f  the instance of Boolean to return
00061         *
00062         * @return the instance of boolean that represents true or false
00063         *         based on f
00064         */
00065         static Handle valueOf(bool f);
00066 
00067         using super::toString;
00068 
00069         /**
00070          * Return "true" or "false" for a given boolean value.
00071          *
00072          * @param f  the boolean value
00073          *
00074          * @return "true" or "false" based on f
00075          *
00076          * @since 12.2.1.3
00077          */
00078         static String::View toString(bool f);
00079     };
00080 
00081 COH_CLOSE_NAMESPACE2
00082 
00083 #endif // COH_BOOLEAN_HPP
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.