1 package evel_javalibrary.att.com;
\r
2 /**************************************************************************//**
\r
4 * Evel Option String class
\r
6 * This file implements the Evel Option class to handle optional String fields.
\r
11 * Licensed under the Apache License, Version 2.0 (the "License");
\r
12 * you may not use this file except in compliance with the License.
\r
13 * You may obtain a copy of the License at
\r
14 * http://www.apache.org/licenses/LICENSE-2.0
\r
16 * Unless required by applicable law or agreed to in writing, software
\r
17 * distributed under the License is distributed on an "AS IS" BASIS,
\r
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
19 * See the License for the specific language governing permissions and
\r
20 * limitations under the License.
\r
21 *****************************************************************************/
\r
23 import javax.json.JsonObjectBuilder;
\r
25 import org.apache.log4j.Logger;
\r
27 * Handles Optional String fields
\r
29 public class EvelOptionString extends EvelOption {
\r
31 /**************************************************************************//**
\r
32 * Optional parameter holder for string.
\r
33 *****************************************************************************/
\r
36 private static final Logger LOGGER = Logger.getLogger( EvelOptionString.class.getName() );
\r
38 public EvelOptionString()
\r
44 public EvelOptionString(boolean val, String str)
\r
50 public void InitValue()
\r
56 public void SetValue(String str)
\r
62 //Sets String value outputting debugging message
\r
63 public void SetValuePr(String str, String mstr)
\r
68 LOGGER.debug("Setting "+mstr+" to "+str);
\r
71 public String GetValue()
\r
76 * Encoding JSON function
\r
77 * @retval boolean returns option true if object is encoded
\r
80 public boolean encJsonValue(JsonObjectBuilder obj, String name)
\r
82 if( is_set ) obj.add(name, value);
\r