org.hpccsystems.ws.client.wrappers.wsdfu.DFUFileTypeWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wsclient Show documentation
Show all versions of wsclient Show documentation
This project allows a user to interact with ESP services in a controlled manner. The API calls available under org.hpccsystems.ws.client.platform allow for a user to target ESP's across multiple environments running a range of hpccsystems-platform versions. There is no guarantee that if a user utilizes org.hpccsystems.ws.client.gen generated stub code from wsdl, that the calls will be backwards compatible with older hpccsystems-platform versions.
/**
*
*/
package org.hpccsystems.ws.client.wrappers.wsdfu;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.hpccsystems.ws.client.gen.axis2.wsdfu.v1_51.DFUFileType;
/**
* DFUFileTypeWrapper
*
* Simple wrapper around WSDFU file type enum generated stub
* Provides layer of indirection between caller and ESP version specific logic
*
*/
public enum DFUFileTypeWrapper
{
Flat ("Flat"),
Index ("Index"),
Xml ("Xml"),
Csv ("Csv"),
Json ("Json");
protected String theDFUFileType;
private static final Map enumtable;
/**
* Instantiates a new DFU file type wrapper.
*
* @param name
* the name
*/
DFUFileTypeWrapper (String name)
{
theDFUFileType = name;
}
/* (non-Javadoc)
* @see java.lang.Enum#toString()
*/
public String toString()
{
return theDFUFileType;
}
static
{
Map map = new ConcurrentHashMap();
for (DFUFileTypeWrapper instance : DFUFileTypeWrapper.values())
{
map.put(instance.toString(),instance);
}
enumtable = Collections.unmodifiableMap(map);
}
/**
* Gets the.
*
* @param name
* the name
* @return the DFU file type wrapper
*/
public static DFUFileTypeWrapper get(String name)
{
return enumtable.get(name);
}
/**
* From string.
*
* @param value
* the value
* @return the DFU file type wrapper
*/
public static DFUFileTypeWrapper fromString(String value)
{
if (value != null && !value.isEmpty() && enumtable.containsKey(value))
{
return enumtable.get(value);
}
throw new IllegalArgumentException("unknown value: " + value);
}
/**
* Gets the FU file type.
*
* @return the FU file type
*/
public DFUFileType getFUFileType()
{
return DFUFileType.Factory.fromValue(theDFUFileType);
}
/**
* From dfu file type.
*
* @param filetype
* the filetype
* @return the DFU file type wrapper
*/
public static DFUFileTypeWrapper fromDfuFileType(DFUFileType filetype)
{
return fromString(filetype.getValue());
}
}