
com.vendasta.salesorders.v1.internal.RevenuePeriod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of salesorders.v1 Show documentation
Show all versions of salesorders.v1 Show documentation
Java SDK for service sales-orders
The newest version!
package com.vendasta.salesorders.v1.internal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
import com.vendasta.salesorders.v1.generated.CommonProto;
/**
* The different periods at which a client can be charged
**/
public enum RevenuePeriod {
ONETIME(0),
DAILY(1),
WEEKLY(2),
BIWEEKLY(3),
MONTHLY(4),
YEARLY(5);
private static final Map protoTypeMap;
static {
Map aMap;
aMap = new HashMap();
aMap.put(CommonProto.RevenuePeriod.ONETIME, RevenuePeriod.ONETIME);
aMap.put(CommonProto.RevenuePeriod.DAILY, RevenuePeriod.DAILY);
aMap.put(CommonProto.RevenuePeriod.WEEKLY, RevenuePeriod.WEEKLY);
aMap.put(CommonProto.RevenuePeriod.BIWEEKLY, RevenuePeriod.BIWEEKLY);
aMap.put(CommonProto.RevenuePeriod.MONTHLY, RevenuePeriod.MONTHLY);
aMap.put(CommonProto.RevenuePeriod.YEARLY, RevenuePeriod.YEARLY);
protoTypeMap = Collections.unmodifiableMap(aMap);
}
private static final Map javaTypeMap;
static {
Map aMap;
aMap = new HashMap();
aMap.put(RevenuePeriod.ONETIME, CommonProto.RevenuePeriod.ONETIME);
aMap.put(RevenuePeriod.DAILY, CommonProto.RevenuePeriod.DAILY);
aMap.put(RevenuePeriod.WEEKLY, CommonProto.RevenuePeriod.WEEKLY);
aMap.put(RevenuePeriod.BIWEEKLY, CommonProto.RevenuePeriod.BIWEEKLY);
aMap.put(RevenuePeriod.MONTHLY, CommonProto.RevenuePeriod.MONTHLY);
aMap.put(RevenuePeriod.YEARLY, CommonProto.RevenuePeriod.YEARLY);
javaTypeMap = Collections.unmodifiableMap(aMap);
}
private int value;
private RevenuePeriod(int i) {
value = i;
}
public int getValue() {
return value;
}
public static RevenuePeriod fromProto(CommonProto.RevenuePeriod proto) {
return protoTypeMap.get(proto);
}
public static List fromProtos(List protos) {
List result = new ArrayList();
for(CommonProto.RevenuePeriod proto : protos) {
result.add(RevenuePeriod.fromProto(proto));
}
return result;
}
public CommonProto.RevenuePeriod toProto() {
return javaTypeMap.get(this);
}
public static List toProtos(List objects) {
List result = new ArrayList();
for(RevenuePeriod obj : objects) {
result.add(obj.toProto());
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy