here is my function
private static List<Types> getShiftTypes() {
List<Types> types = new ArrayList<>();
for (String shift : shifts_arr_t) {
if (!types.contains(shift)) {
types.add(new Types(shift));
}
}
return types;
}
Types:
public class Types
{
String type;
int count;
public Types(String type) {
this.type = type;
}
@Override
public boolean equals(Object object)
{
boolean sameSame = false;
if (object != null && object instanceof Types)
{
sameSame = this.type == ((Types) object).type;
}
return sameSame;
}
}
But the compare override is not working. Can you please help me with that?