package com.zy.asrs.wcs.core.model.enums; /** * 四向穿梭车运行方向 */ public enum ShuttleRunDirection { TOP((short)2, "货物方向-"), BOTTOM((short)1, "货物方向+"), LEFT((short)3, "过道方向-"), RIGHT((short)4, "过道方向+"), ; public Short id; public String desc; ShuttleRunDirection(Short id, String desc) { this.id = id; this.desc = desc; } public static ShuttleRunDirection get(String direction) { if (null == direction) { return null; } if (direction.equals("top")) { return TOP; } else if (direction.equals("bottom")) { return BOTTOM; } else if (direction.equals("left")) { return LEFT; } else if (direction.equals("right")) { return RIGHT; }else { return null; } } public static ShuttleRunDirection get(Short id) { if (null == id) { return null; } for (ShuttleRunDirection type : ShuttleRunDirection.values()) { if (type.id.equals(id.shortValue())) { return type; } } return null; } public static ShuttleRunDirection get(ShuttleRunDirection type) { if (null == type) { return null; } for (ShuttleRunDirection shuttleRunDirection : ShuttleRunDirection.values()) { if (shuttleRunDirection == type) { return shuttleRunDirection; } } return null; } }