ilog.rules.teamserver.brm

Class Contributor

  • java.lang.Object
    • ilog.rules.teamserver.brm.Contributor
  • All Implemented Interfaces:
    java.io.Serializable


    public class Contributor
    extends java.lang.Object
    implements java.io.Serializable

    The notion of contributor abstracts these of author, tester, or approver in the Decision Governance Framework. An instance of this class stores a user name and a status. A status is an arbitrary string, and its range is controlled outside of this class. This class also introduces the Contributor.Role enumeration, to denote whether the contributor is an author, a tester, an approver, and so on.

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  Contributor.Role
      This enumeration is used to denote whether a contributor is an author or a tester (Author), or an approver (Approver).
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected java.lang.String fullname 
      protected java.lang.String name 
      protected java.lang.String status 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Contributor(java.lang.String nameAndStatus)
      Creates a contributor with the name and status provided in the argument as a colon-separated string.
      Contributor(java.lang.String name, java.lang.String status)
      Creates a contributor with the provided name and status.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.util.List<Contributor> convert(java.util.List<?> raw_value)
      Returns a list of contributors that matches the provided list.
      boolean equals(java.lang.Object obj) 
      static Contributor find(java.lang.String userName, java.util.List<Contributor> contributors)
      Returns the first contributor in the provided list that goes by the provided name, or null if none is found.
      java.lang.String getName()
      Returns the name of the contributor.
      java.lang.String getStatus()
      Returns the status of the contributor.
      int hashCode() 
      static boolean remove(java.lang.String userName, java.util.List<Contributor> contributors)
      Removes the first contributor in the provided list that goes by the provided name.
      void setName(java.lang.String name)
      Sets the name of the contributor.
      void setStatus(java.lang.String status)
      Sets the status of the contributor.
      java.lang.String toString() 
      static java.util.List<Contributor> update(Contributor contributor, java.util.List<Contributor> contributors)
      Finds the first contributor in the provided list that goes by the same name as the provided contributor, and replaces it with the latter.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
      • status

        protected java.lang.String status
      • fullname

        protected java.lang.String fullname
    • Constructor Detail

      • Contributor

        public Contributor(java.lang.String name,
                   java.lang.String status)

        Creates a contributor with the provided name and status.

        Parameters:
        name - The name of the contributor.
        status - The status of the contributor.
      • Contributor

        public Contributor(java.lang.String nameAndStatus)

        Creates a contributor with the name and status provided in the argument as a colon-separated string.

        Throws:
        java.lang.IllegalArgumentException - If the argument contains no colon.
        Parameters:
        nameAndStatus - The name and status of the contributor, for example "alice:Ready".
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getName

        public java.lang.String getName()

        Returns the name of the contributor.

        Returns:
        The name of the contributor.
      • setName

        public void setName(java.lang.String name)

        Sets the name of the contributor.

        Parameters:
        name - The new name of the contributor.
      • getStatus

        public java.lang.String getStatus()

        Returns the status of the contributor.

        Returns:
        The status of the contributor.
      • setStatus

        public void setStatus(java.lang.String status)

        Sets the status of the contributor.

        Parameters:
        status - The new status of the contributor.
      • find

        public static Contributor find(java.lang.String userName,
                       java.util.List<Contributor> contributors)

        Returns the first contributor in the provided list that goes by the provided name, or null if none is found.

        Parameters:
        userName - The name of the contributor that is looked for.
        contributors - A list of contributors. May be null.
        Returns:
        The first contributor with this name, or null if none is found.
      • update

        public static java.util.List<Contributor> update(Contributor contributor,
                                         java.util.List<Contributor> contributors)

        Finds the first contributor in the provided list that goes by the same name as the provided contributor, and replaces it with the latter. The provided list is not copied, it is modified.

        Parameters:
        contributor - A contributor. Nothing happens if null is given.
        contributors - A list of contributors. May be null.
        Returns:
        The updated list of contributors.
      • remove

        public static boolean remove(java.lang.String userName,
                     java.util.List<Contributor> contributors)

        Removes the first contributor in the provided list that goes by the provided name.

        Parameters:
        userName - The name of the contributor to remove.
        contributors - A list of contributors. May be null.
        Returns:
        true if a contributor was removed, false otherwise.
      • convert

        public static java.util.List<Contributor> convert(java.util.List<?> raw_value)

        Returns a list of contributors that matches the provided list. The provided list must either be a list of Contributors, in which case it is returned untouched, or a list of names and statuses as colon-separated strings (for example "alice:Ready"), in which case Contributor instances are created, and their list is returned.

        Parameters:
        raw_value - Either a list of Contributors, or a list of strings of the form "alice:Ready".
        Returns:
        a list of contributors.

© Copyright IBM Corp. 1987, 2017