Class CustomCode

java.lang.Object
nz.org.riskscape.engine.CustomCode
All Implemented Interfaces:
ProblemCode

public class CustomCode extends Object implements ProblemCode

A unique/one-off custom code to use as a Problem's code. Problem.getCode().toKey() becomes the canonical name of the object that generated the Problem, with the given suffix appended.

  • Constructor Details

    • CustomCode

      public CustomCode(String suffix, Object affected)
  • Method Details

    • getAffectedClass

      public Class<?> getAffectedClass()
    • toKey

      public String toKey()
      Description copied from interface: ProblemCode

      A key to use for i18n look ups to describe this problem.

      Specified by:
      toKey in interface ProblemCode
    • name

      public String name()
      Description copied from interface: ProblemCode

      The name of this code, unique among all other codes in its class

      Specified by:
      name in interface ProblemCode