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

com.gitee.yanfanvip.model.ReciveEnum Maven / Gradle / Ivy

The newest version!
package com.gitee.yanfanvip.model;

import java.io.DataInputStream;
import java.io.IOException;

public enum ReciveEnum {
	PING(5),
	PULLDATA(6),
	SYNC(7);
	
	private final int type;
	private ReciveEnum(int type) {
		this.type = type;
	}
	public int getType() {
		return type;
	}
	
	public static ReciveEnum get(int type) {
		for (ReciveEnum e : ReciveEnum.values()) {
			if(e.type == type){
				return e;
			}
		}
		return null;
	}
	
	public static ReciveEnum get(DataInputStream in) throws IOException {
		int type = in.readInt();
		for (ReciveEnum e : ReciveEnum.values()) {
			if(e.type == type){
				return e;
			}
		}
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy