1 package evel_javalibrary.att.com;
\r
2 /**************************************************************************//**
\r
4 * Evel Option Time class
\r
6 * This file implements the Evel Option Time class to handle optional time fields.
\r
10 * Unless otherwise specified, all software contained herein is
\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 java.util.Date;
\r
25 import javax.json.JsonObjectBuilder;
\r
26 import javax.json.JsonValue;
\r
28 import org.apache.log4j.Logger;
\r
30 * Handles Optional Date/Time fields
\r
32 public class EvelOptionTime extends EvelOption {
\r
34 /**************************************************************************//**
\r
35 * Optional parameter holder for string.
\r
36 *****************************************************************************/
\r
39 private static final Logger LOGGER = Logger.getLogger( EvelOptionTime.class.getName() );
\r
41 public EvelOptionTime()
\r
47 public EvelOptionTime(boolean val, Date str)
\r
53 public void InitValue()
\r
59 public void SetValue(Date str)
\r
65 //Sets Date value outputting debugging message
\r
66 public void SetValuePr(Date str, String mstr)
\r
71 LOGGER.debug("Setting "+mstr+" to "+str);
\r
74 public Date GetValue()
\r
79 * Encoding JSON function
\r
80 * @retval boolean returns option true if object is encoded
\r
83 public boolean encJsonValue(JsonObjectBuilder obj, String name)
\r
85 if( is_set ) obj.add(name, (JsonValue) value);
\r