Esempio n. 1
0
 /**
  * Checks if the given String is one of the URIs defined of TOSCA (build and termination plan). If
  * not, the Type is of OTHERMANAGEMENT.
  *
  * <p>For example: The given parameter contains the URI
  * http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan. This URI is mapped to the enum
  * BUILD.
  *
  * @param planType String
  * @return PublicPlanTypes plan type.
  */
 public static PublicPlanTypes isPlanTypeURI(String planType) {
   if (planType.startsWith(PublicPlanTypes.BUILD.toString())) {
     return BUILD;
   } else if (planType.startsWith(PublicPlanTypes.TERMINATION.toString())) {
     return TERMINATION;
   } else {
     return OTHERMANAGEMENT;
   }
 }
Esempio n. 2
0
 /**
  * This method returns the String representation of the type. For example: <br>
  * The enum BUILD has the URI http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan.
  * This method returns for BUILD the String "BUILD".
  *
  * @return String representation
  */
 public String toEnumRepresentation() {
   if (this.type.startsWith(PublicPlanTypes.BUILD.toString())) {
     return "BUILD";
   } else if (this.type.startsWith(PublicPlanTypes.TERMINATION.toString())) {
     return "TERMINATION";
   } else {
     return "OTHERMANAGEMENT";
   }
 }