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

com.kuangkie.carbon.common.StatGeneratorMsg Maven / Gradle / Ivy

The newest version!
package com.kuangkie.carbon.common;

import java.util.ArrayList;
import java.util.Collection;

import com.kuangkie.carbon.enun.MessageState;

public class StatGeneratorMsg {

	private MessageState state = MessageState.SUCCESS;
	private  String describe;

	public StatGeneratorMsg() {
	}

	private Collection refuse = new ArrayList(),
			syserror = new ArrayList();

	public void setState(MessageState state,String describe) {
		 this.state=state;
		 this.describe=describe;
	}
	
	public MessageState getState() {
		return state;
	}

	public void addIntegrationMsg(IntegrationMsg integrationMsg) {
		if (state == MessageState.SUCCESS) {
			state = integrationMsg.getState();
		}
		switch (integrationMsg.getState()) {
		case REFUSE:
			refuse.add(integrationMsg);
			break;
		case SYSERROR:
			syserror.add(integrationMsg);
			break;
		default:
			break;
		}
	}

	public Collection getRefuse() {
		return refuse;
	}

	public Collection getSyserror() {
		return syserror;
	}

	public boolean success() {
		return MessageState.SUCCESS == getState();
	}

	public String getDescribe() {
		return describe==null?"":describe;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy