@Test public void testEquals() throws Exception { Random random = new Random(); CmdletInfo cmdletInfo = new CmdletInfo( random.nextLong(), random.nextLong(), CmdletState.NOTINITED, " ", random.nextLong(), random.nextLong()); Assert.assertEquals(true, cmdletInfo.equals(cmdletInfo)); Assert.assertEquals(false, cmdletInfo.equals(new Object())); Assert.assertEquals(false, new Object().equals(cmdletInfo)); Assert.assertEquals(false, cmdletInfo.equals(null)); CmdletInfo cmdletInfo1 = new CmdletInfo(1, 1, CmdletState.CANCELLED, "test", 1, 1); CmdletInfo cmdletInfo2 = new CmdletInfo(1, 1, CmdletState.CANCELLED, "test", 1, 1); Assert.assertEquals(true, cmdletInfo1.equals(cmdletInfo2)); cmdletInfo1 = new CmdletInfo(1, 1, CmdletState.CANCELLED, null, 1, 1); cmdletInfo2 = new CmdletInfo(1, 1, CmdletState.CANCELLED, "test", 1, 1); Assert.assertEquals(false, cmdletInfo1.equals(cmdletInfo2)); Assert.assertEquals(false, cmdletInfo2.equals(cmdletInfo1)); cmdletInfo1 = new CmdletInfo(1, 1, CmdletState.CANCELLED, null, 1, 1); cmdletInfo2 = new CmdletInfo(1, 1, CmdletState.CANCELLED, null, 1, 1); Assert.assertEquals(true, cmdletInfo1.equals(cmdletInfo2)); cmdletInfo1 = new CmdletInfo(1, 1, null, "test", 1, 1); cmdletInfo2 = new CmdletInfo(1, 1, CmdletState.CANCELLED, "test", 1, 1); Assert.assertEquals(false, cmdletInfo1.equals(cmdletInfo2)); cmdletInfo1 = new CmdletInfo(1, 1, null, "test", 1, 1); cmdletInfo2 = new CmdletInfo(1, 1, null, "test", 1, 1); Assert.assertEquals(true, cmdletInfo1.equals(cmdletInfo2)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CmdletInfo that = (CmdletInfo) o; return cid == that.cid && rid == that.rid && generateTime == that.generateTime && stateChangedTime == that.stateChangedTime && deferedToTime == that.deferedToTime && Objects.equals(aids, that.aids) && state == that.state && Objects.equals(parameters, that.parameters); }
CmdletInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CmdletInfo that = (CmdletInfo) o; return cid == that.cid && rid == that.rid && generateTime == that.generateTime && stateChangedTime == that.stateChangedTime && deferedToTime == that.deferedToTime && Objects.equals(aids, that.aids) && state == that.state && Objects.equals(parameters, that.parameters); } }
CmdletInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CmdletInfo that = (CmdletInfo) o; return cid == that.cid && rid == that.rid && generateTime == that.generateTime && stateChangedTime == that.stateChangedTime && deferedToTime == that.deferedToTime && Objects.equals(aids, that.aids) && state == that.state && Objects.equals(parameters, that.parameters); } CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime); }
CmdletInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CmdletInfo that = (CmdletInfo) o; return cid == that.cid && rid == that.rid && generateTime == that.generateTime && stateChangedTime == that.stateChangedTime && deferedToTime == that.deferedToTime && Objects.equals(aids, that.aids) && state == that.state && Objects.equals(parameters, that.parameters); } CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime); @Override String toString(); void addAction(long aid); List<Long> getAids(); List<String> getAidsString(); long getCid(); void setCid(long cid); long getRid(); void setRid(long rid); void setAids(List<Long> aids); CmdletState getState(); void setState(CmdletState state); void updateState(CmdletState state); String getParameters(); void setParameters(String parameters); long getGenerateTime(); long getStateChangedTime(); void setStateChangedTime(long stateChangedTime); long getDeferedToTime(); @Override boolean equals(Object o); @Override int hashCode(); static Builder newBuilder(); }
CmdletInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CmdletInfo that = (CmdletInfo) o; return cid == that.cid && rid == that.rid && generateTime == that.generateTime && stateChangedTime == that.stateChangedTime && deferedToTime == that.deferedToTime && Objects.equals(aids, that.aids) && state == that.state && Objects.equals(parameters, that.parameters); } CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime);  CmdletInfo(long cid, long rid, List<Long> aids, CmdletState state,
      String parameters, long generateTime, long stateChangedTime, long deferedToTime); @Override String toString(); void addAction(long aid); List<Long> getAids(); List<String> getAidsString(); long getCid(); void setCid(long cid); long getRid(); void setRid(long rid); void setAids(List<Long> aids); CmdletState getState(); void setState(CmdletState state); void updateState(CmdletState state); String getParameters(); void setParameters(String parameters); long getGenerateTime(); long getStateChangedTime(); void setStateChangedTime(long stateChangedTime); long getDeferedToTime(); @Override boolean equals(Object o); @Override int hashCode(); static Builder newBuilder();  }