ModulePropertiesRecord

public class ModulePropertiesRecord

Class representing a record of a certain module properties. This class is exposed as an org.motechproject.mds.annotations.Entity through Motech Data Services.

See also: org.motechproject.mds.annotations

Fields

PROPERTIES_FILE_EXTENSION

public static final String PROPERTIES_FILE_EXTENSION

Constructors

ModulePropertiesRecord

public ModulePropertiesRecord()

Default constructor.

ModulePropertiesRecord

public ModulePropertiesRecord(Map<String, Object> properties, String bundle, String version, String filename, boolean raw)

Constructor.

Parameters:
  • properties – the module properties
  • bundle – the modules bundle symbolic name
  • version – the version of the module
  • filename – the name of the file containing module properties
  • raw – the flag defining whether the properties are raw or not

ModulePropertiesRecord

public ModulePropertiesRecord(Properties props, String bundle, String version, String filename, boolean raw)

Constructor.

Parameters:
  • props – the module properties
  • bundle – the modules bundle symbolic name
  • version – the version of the module
  • filename – the name of the file containing modules properties
  • raw – the flag defining whether the properties are raw or not

Methods

buildFrom

public static ModulePropertiesRecord buildFrom(File file)

Builds an instance of ModulePropertiesRecord from given file. Content of the file must match format specified in Properties.load(Reader). Properties files are treated as raw configuration files.

Parameters:
  • file – the source file, null returns null
Returns:

the instance of ModulePropertiesRecord, null if error occurred

equals

public boolean equals(Object obj)

getBundle

public String getBundle()

getFilename

public String getFilename()

getProperties

public Map<String, Object> getProperties()

getVersion

public String getVersion()

hashCode

public int hashCode()

isRaw

public boolean isRaw()

sameAs

public boolean sameAs(Object dataObject)

Checks whether given object is the same as this object.

Parameters:
  • dataObject – the object to be compared
Returns:

true if objects are the same, false otherwise

setBundle

public void setBundle(String bundle)

setFilename

public void setFilename(String filename)

setProperties

public void setProperties(Map<String, Object> properties)

setRaw

public void setRaw(boolean raw)

setVersion

public void setVersion(String version)

toString

public String toString()