Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2013 Ning, Inc.
   *
   * Ning licenses this file to you 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.
  */
 
 package com.ning.billing.util.tag;
 
 import java.util.List;
 import java.util.UUID;
 
 
 public enum ControlTagType {
 
     AUTO_PAY_OFF(new UUID(0, 1), "Suspends payments until removed."truefalse, Collections.<ObjectType>singletonList(.)),
     AUTO_INVOICING_OFF(new UUID(0, 2), "Suspends invoicing until removed."falsetrue, Collections.<ObjectType>singletonList(.)),
     OVERDUE_ENFORCEMENT_OFF(new UUID(0, 3), "Suspends overdue enforcement behaviour until removed."falsefalse, Collections.<ObjectType>singletonList(.)),
     WRITTEN_OFF(new UUID(0, 4), "Indicates that an invoice is written off. No billing or payment effect."falsefalse, Collections.<ObjectType>singletonList(.)),
     MANUAL_PAY(new UUID(0, 5), "Indicates that Killbill doesn't process payments for that account (external payments only)"truefalse, Collections.<ObjectType>singletonList(.)),
     TEST(new UUID(0, 6), "Indicates that this is a test account"falsefalse, Collections.<ObjectType>singletonList(....)),
     PARTNER(new UUID(0, 7), "Indicates that this is a partner account"falsefalse, Collections.<ObjectType>singletonList(....));
 
     private final UUID id;
     private final String description;
     private final boolean autoPaymentOff;
     private final boolean autoInvoicingOff;
     private final List<ObjectTypeapplicableObjectTypes;
 
     ControlTagType(final UUID idfinal String descriptionfinal boolean autoPaymentOfffinal boolean autoInvoicingOff,
                    final List<ObjectTypeapplicableObjectTypes) {
         this. = id;
         this. = description;
         this. = autoPaymentOff;
         this. = autoInvoicingOff;
         this. = applicableObjectTypes;
     }
 
     public UUID getId() {
         return ;
     }
 
     public String getDescription() {
         return this.;
     }
 
     public boolean getAutoPaymentOff() {
         return this.;
     }
 
     public boolean getAutoInvoicingOff() {
         return this.;
     }
 
     public List<ObjectTypegetApplicableObjectTypes() {
         return ;
     }
 
     public static ControlTagType getTypeFromId(final UUID targetId) {
         for (ControlTagType cur : values()) {
             if (cur.getId().equals(targetId)) {
                 return cur;
             }
         }
         return null;
     }

    
Convenience method to return whether an account is configured with auto_pay_off (information of which control tag is configured with which behavior stays here)

Parameters:
input tagDefinitionIds for all the tags associated to a given account
Returns:
whether that account is set with auto_pay_off
 
     public static boolean isAutoPayOff(final Collection<UUIDinput) {
         for (UUID cur : input) {
             for (ControlTagType controlTag : values()) {
                 if (controlTag.getId().equals(cur) && controlTag.getAutoPaymentOff()) {
                     return true;
                 }
             }
         }
         return false;
     }

    
Convenience method to return whether an account is configured with auto_invoicing_off (information of which control tag is configured with which behavior stays here)

Parameters:
input tagDefinitionIds for all the tags associated to a given account
Returns:
whether that account is set with auto_invoicing_off
    public static boolean isAutoInvoicingOff(final Collection<UUIDinput) {
        for (UUID cur : input) {
            for (ControlTagType controlTag : values()) {
                if (controlTag.getId().equals(cur) && controlTag.getAutoInvoicingOff()) {
                    return true;
                }
            }
        }
        return false;
    }
New to GrepCode? Check out our FAQ X