/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.common.concurrent.collection.impl;

import com.crunii.micro.common.concurrent.collection.RemoveId;
import lombok.Data;

import java.io.Serializable;

/**
 * @author 田平 create 2022-08-03 14:53:16
 */
@Data
public class SimpleRemoveId implements RemoveId, Serializable, Comparable<SimpleRemoveId> {
	private static final long serialVersionUID = 1L;

	private String id;

	private String data;

	public SimpleRemoveId(String id) {
		this.id = id;
		this.data = id + "100";
	}

	@Override
	public String getRemoveId() {
		return data;
	}

	@Override
	public int compareTo(SimpleRemoveId that) {
		if (this.id.compareTo(that.id) < 0) {
			return -1;
		} else if (this.id.compareTo(that.id) > 0) {
			return 1;
		}

		if (this.data.compareTo(that.data) < 0) {
			return -1;
		} else if (this.data.compareTo(that.data) > 0) {
			return 1;
		}
		return 0;
	}
}
