@Override public boolean equals(Object obj) { Object jobExecutionId = getJobExecutionId(); if (jobExecutionId == null || !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return stepName.equals(other.getStepName()) && (jobExecutionId.equals(other.getJobExecutionId())) && getId().equals(other.getId()); }
/** * Test method for {@link org.springframework.batch.core.Entity#equals(java.lang.Object)}. */ public void testEqualsNull() { assertFalse(entity.equals(null)); }
/** * Test method for {@link org.springframework.batch.core.Entity#equals(java.lang.Object)}. */ public void testEqualsObject() { assertFalse(entity.equals(new Object())); }
/** * Test method for {@link org.springframework.batch.core.Entity#equals(java.lang.Object)}. */ public void testEqualsEntityWrongId() { assertFalse(entity.equals(new Entity())); }
@Test public void testEqualsWithNull() throws Exception { Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11)); assertFalse(stepExecution.equals(null)); }
@Test public void testEqualsWithNullIdentifiers() throws Exception { Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11)); assertFalse(stepExecution.equals(blankExecution)); }
@Test public void testEqualsWithNullJob() throws Exception { Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11)); assertFalse(stepExecution.equals(blankExecution)); }
@Test public void testEqualsWithSameName() throws Exception { Step step = new StepSupport("stepName"); Entity stepExecution1 = newStepExecution(step,11L,4L); Entity stepExecution2 = newStepExecution(step,11L,5L); assertFalse(stepExecution1.equals(stepExecution2)); }
public boolean equals(Object obj) { Object jobExecutionId = getJobExecutionId(); if (jobExecutionId == null || !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return stepName.equals(other.getStepName()) && (jobExecutionId.equals(other.getJobExecutionId())); }
@Override public boolean equals(Object obj) { Object jobExecutionId = getJobExecutionId(); if (jobExecutionId == null || !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return stepName.equals(other.getStepName()) && (jobExecutionId.equals(other.getJobExecutionId())) && getId().equals(other.getId()); }
@Override public boolean equals(Object obj) { Object jobExecutionId = getJobExecutionId(); if (jobExecutionId == null || !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return stepName.equals(other.getStepName()) && (jobExecutionId.equals(other.getJobExecutionId())) && getId().equals(other.getId()); }
@Override public boolean equals(Object obj) { if ( !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return this.stepName.equals(other.getStepName()) && (this.jobExecutionId == other.getJobExecutionId()) && getId().equals(other.getId()); }
@Override public boolean equals(Object obj) { Object jobExecutionId = getJobExecutionId(); if (jobExecutionId == null || !(obj instanceof StepExecution) || getId() == null) { return super.equals(obj); } StepExecution other = (StepExecution) obj; return stepName.equals(other.getStepName()) && (jobExecutionId.equals(other.getJobExecutionId())) && getId().equals(other.getId()); }