com.cisco.oss.foundation.configuration.validation.params.SimpleParamFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configuration-api Show documentation
Show all versions of configuration-api Show documentation
This project is the api library for configuration in the cisco vss foundation runtime
/*
* Copyright 2014 Cisco Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cisco.oss.foundation.configuration.validation.params;
import static com.cisco.oss.foundation.configuration.validation.params.ParamReaders.*;
import static com.cisco.oss.foundation.configuration.validation.params.ParamValidators.*;
/**
* Created By: kgreen
* Date-Time: 10/3/13 9:48 AM
*/
public class SimpleParamFactory extends ParamFactory {
protected SimpleParamFactory(ParamType paramType) {
super(paramType);
}
public Param asString (String name) {
return getParam(stringReader, name);
}
public Param asString (String name, String defValue) {
return getParam(stringReader, name, defValue);
}
public Param asString (String name, String defValue, ParamValidator validator) {
return getParam(stringReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asInt (String name) {
return getParam(intReader, name);
}
public Param asInt (String name, Integer defValue) {
return getParam(intReader, name, defValue);
}
public Param asInt (String name, Integer defValue, ParamValidator validator) {
return getParam(intReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asLong (String name) {
return getParam(longReader, name);
}
public Param asLong (String name, Long defValue) {
return getParam(longReader, name, defValue);
}
public Param asLong (String name, Long defValue, ParamValidator validator) {
return getParam(longReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asBool (String name) {
return getParam(booleanReader, name);
}
public Param asBool (String name, Boolean defValue) {
return getParam(booleanReader, name, defValue);
}
public Param asBool (String name, Boolean defValue, ParamValidator validator) {
return getParam(booleanReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asFloat (String name) {
return getParam(floatReader, name);
}
public Param asFloat (String name, Float defValue) {
return getParam(floatReader, name, defValue);
}
public Param asFloat (String name, Float defValue, ParamValidator validator) {
return getParam(floatReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asDouble (String name) {
return getParam(doubleReader, name);
}
public Param asDouble (String name, Double defValue) {
return getParam(doubleReader, name, defValue);
}
public Param asDouble (String name, Double defValue, ParamValidator validator) {
return getParam(doubleReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asShort (String name) {
return getParam(shortReader, name);
}
public Param asShort (String name, Short defValue) {
return getParam(shortReader, name, defValue);
}
public Param asShort (String name, Short defValue, ParamValidator validator) {
return getParam(shortReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asByte (String name) {
return getParam(byteReader, name);
}
public Param asByte (String name, Byte defValue) {
return getParam(byteReader, name, defValue);
}
public Param asByte (String name, Byte defValue, ParamValidator validator) {
return getParam(byteReader, name, defValue, validator);
}
//****************************************************************************************************
public Param asAny (ParamReader reader, String name) {
return getParam(reader, name);
}
public Param asAny (ParamReader reader, String name, T defValue) {
return getParam(reader, name, defValue);
}
public Param asAny (ParamReader reader, String name, T defValue, ParamValidator validator) {
return getParam(reader, name, defValue, validator);
}
//****************************************************************************************************
}