KeyValue

public class KeyValue

Class representing mapping from one parameter key-value pair to another. Used in org.motechproject.eventlogging.converter.impl.DefaultDbToLogConverter to replace those pairs before persisting logs in the database.

Constructors

KeyValue

public KeyValue(String startKey, Object startValue, String endKey, Object endValue, boolean isOptional)

Creates an instance of KeyValue from passed parameters. If an event contains key specified in startKey and value of this key equals startValue, then that key will be replaced by endKey and that value by endValue.

Parameters:
  • startKey – key to replace
  • startValue – value of replacing key
  • endKey – new key
  • endValue – new value for new key
  • isOptional – have no use at the moment

Methods

getEndKey

public String getEndKey()

getEndValue

public Object getEndValue()

getStartKey

public String getStartKey()

getStartValue

public Object getStartValue()

isOptional

public boolean isOptional()

setEndKey

public void setEndKey(String endKey)

setEndValue

public void setEndValue(Object endValue)

setOptional

public void setOptional(boolean isOptional)

setStartKey

public void setStartKey(String startKey)

setStartValue

public void setStartValue(Object startValue)