ConfigSource

public final class ConfigSource

Represents the source from which MOTECH configuration should be read.

Fields

FILE

public static final ConfigSource FILE

UI

public static final ConfigSource UI

Methods

getName

public String getName()

isFile

public boolean isFile()

Checks whether this configuration source is FILE or not.

Returns:true if this configuration source is file, false otherwise

isValid

public static boolean isValid(String name)

Checks whether given name is a name of supported configuration source.

Parameters:
  • name – the name to be checked
Returns:

true if name is valid, false otherwise

toString

public String toString()

valueOf

public static ConfigSource valueOf(String name)

Creates proper object of ConfigSource class for given name. The correct values are “UI” and “FILE”. If name isn’t one of above MotechConfigurationException will be thrown.

Parameters:
  • name – the name of the configuration source, null and blank String treated as “UI”
Throws:
Returns:

proper instance of ConfigSource