com.nepxion.discovery.common.entity.StrategyCustomizationEntity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discovery-common Show documentation
Show all versions of discovery-common Show documentation
Nepxion Discovery is an enhancement for Spring Cloud Discovery
package com.nepxion.discovery.common.entity;
/**
* Title: Nepxion Discovery
* Description: Nepxion Discovery
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class StrategyCustomizationEntity implements Serializable {
private static final long serialVersionUID = 4903833660194433964L;
private List strategyConditionEntityList;
private List strategyRouteEntityList;
public List getStrategyConditionEntityList() {
return strategyConditionEntityList;
}
public void setStrategyConditionEntityList(List strategyConditionEntityList) {
this.strategyConditionEntityList = strategyConditionEntityList;
}
public List getStrategyRouteEntityList() {
return strategyRouteEntityList;
}
public void setStrategyRouteEntityList(List strategyRouteEntityList) {
this.strategyRouteEntityList = strategyRouteEntityList;
// Header参数越多,越排在前面
Collections.sort(this.strategyConditionEntityList, new Comparator() {
public int compare(StrategyConditionEntity object1, StrategyConditionEntity object2) {
Integer count1 = object1.getHeaderMap().size();
Integer count2 = object2.getHeaderMap().size();
return count2.compareTo(count1);
}
});
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object object) {
return EqualsBuilder.reflectionEquals(this, object);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy