Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * #%L
   * BroadleafCommerce Framework
   * %%
   * Copyright (C) 2009 - 2013 Broadleaf Commerce
   * %%
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * 
  *       http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * #L%
  */
 package org.broadleafcommerce.core.order.service.type;
 
 
 import java.util.Map;

An extendible enumeration of fulfillment group types.

Author(s):
jfischer
 
 public class FulfillmentType implements SerializableBroadleafEnumerationType {
 
     private static final long serialVersionUID = 1L;
 
     private static final Map<StringFulfillmentTypeTYPES = new LinkedHashMap<StringFulfillmentType>();
 
     public static final FulfillmentType DIGITAL = new FulfillmentType("DIGITAL""Digital");
     public static final FulfillmentType PHYSICAL_SHIP = new FulfillmentType("PHYSICAL_SHIP""Physical Ship");
     public static final FulfillmentType PHYSICAL_PICKUP = new FulfillmentType("PHYSICAL_PICKUP""Physical Pickup");
     public static final FulfillmentType PHYSICAL_PICKUP_OR_SHIP = new FulfillmentType("PHYSICAL_PICKUP_OR_SHIP""Physical Pickup or Ship");
     public static final FulfillmentType GIFT_CARD = new FulfillmentType("GIFT_CARD""Gift Card");
 
     public static FulfillmentType getInstance(final String type) {
         return .get(type);
     }
 
     private String type;
     private String friendlyType;
 
     public FulfillmentType() {
         //do nothing
     }
 
     public FulfillmentType(final String typefinal String friendlyType) {
         this. = friendlyType;
         setType(type);
     }
 
     @Override
     public String getType() {
         return ;
     }
 
     @Override
     public String getFriendlyType() {
         return ;
     }
 
     private void setType(final String type) {
         this. = type;
         if (!.containsKey(type)) {
             .put(typethis);
         }
     }
 
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = 1;
         result = prime * result + (( == null) ? 0 : .hashCode());
         return result;
     }
 
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
             return true;
         if (obj == null)
             return false;
         if (getClass() != obj.getClass())
             return false;
         FulfillmentType other = (FulfillmentTypeobj;
         if ( == null) {
             if (other.type != null)
                 return false;
         } else if (!.equals(other.type))
            return false;
        return true;
    }
New to GrepCode? Check out our FAQ X