All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vendasta.sales.v1.internal.ActionCategory Maven / Gradle / Ivy

The newest version!
package com.vendasta.sales.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.sales.v1.generated.UserActionsProto;

/**
 * 
 **/
public enum ActionCategory { 
	ACTION_CATEGORY_UNKNOWN(0),
		ACTION_CATEGORY_CLICK(1),
		ACTION_CATEGORY_VIEW(2),
		ACTION_CATEGORY_LINGER(3),
		ACTION_CATEGORY_TYPED(4),
		ACTION_CATEGORY_PURCHASED(5),
		ACTION_CATEGORY_ADDED_TO_CART(6);
	
	private static final Map protoTypeMap;
	static {
		Map aMap;
		aMap = new HashMap();
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_UNKNOWN, ActionCategory.ACTION_CATEGORY_UNKNOWN);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_CLICK, ActionCategory.ACTION_CATEGORY_CLICK);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_VIEW, ActionCategory.ACTION_CATEGORY_VIEW);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_LINGER, ActionCategory.ACTION_CATEGORY_LINGER);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_TYPED, ActionCategory.ACTION_CATEGORY_TYPED);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_PURCHASED, ActionCategory.ACTION_CATEGORY_PURCHASED);
		aMap.put(UserActionsProto.ActionCategory.ACTION_CATEGORY_ADDED_TO_CART, ActionCategory.ACTION_CATEGORY_ADDED_TO_CART);
		protoTypeMap = Collections.unmodifiableMap(aMap);
	}

	private static final Map javaTypeMap;
	static {
		Map aMap;
		aMap = new HashMap();
		aMap.put(ActionCategory.ACTION_CATEGORY_UNKNOWN, UserActionsProto.ActionCategory.ACTION_CATEGORY_UNKNOWN);
		aMap.put(ActionCategory.ACTION_CATEGORY_CLICK, UserActionsProto.ActionCategory.ACTION_CATEGORY_CLICK);
		aMap.put(ActionCategory.ACTION_CATEGORY_VIEW, UserActionsProto.ActionCategory.ACTION_CATEGORY_VIEW);
		aMap.put(ActionCategory.ACTION_CATEGORY_LINGER, UserActionsProto.ActionCategory.ACTION_CATEGORY_LINGER);
		aMap.put(ActionCategory.ACTION_CATEGORY_TYPED, UserActionsProto.ActionCategory.ACTION_CATEGORY_TYPED);
		aMap.put(ActionCategory.ACTION_CATEGORY_PURCHASED, UserActionsProto.ActionCategory.ACTION_CATEGORY_PURCHASED);
		aMap.put(ActionCategory.ACTION_CATEGORY_ADDED_TO_CART, UserActionsProto.ActionCategory.ACTION_CATEGORY_ADDED_TO_CART);
		javaTypeMap = Collections.unmodifiableMap(aMap);
	}

	private int value;

	private ActionCategory(int i) {
		value = i;
	}
	public int getValue() {
		return value;
	}

	public static ActionCategory fromProto(UserActionsProto.ActionCategory proto) {
		return protoTypeMap.get(proto);
	}

	public static List fromProtos(List protos) {
		List result = new ArrayList();
		for(UserActionsProto.ActionCategory proto : protos) {
			result.add(ActionCategory.fromProto(proto));
		}
		return result;
	}

	public UserActionsProto.ActionCategory toProto() {
		return javaTypeMap.get(this);
	}

	public static List toProtos(List objects) {
		List result = new ArrayList();
		for(ActionCategory obj : objects) {
			result.add(obj.toProto());
		}
		return result;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy