@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceIdentifier() == null) ? 0 : getSourceIdentifier().hashCode()); hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode()); hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode()); hashCode = prime * hashCode + ((getDate() == null) ? 0 : getDate().hashCode()); hashCode = prime * hashCode + ((getEventId() == null) ? 0 : getEventId().hashCode()); return hashCode; }
/** * <p> * The date and time of the event. * </p> * * @param date * The date and time of the event. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withDate(java.util.Date date) { setDate(date); return this; }
/** * <p> * The identifier of the event. * </p> * * @param eventId * The identifier of the event. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withEventId(String eventId) { setEventId(eventId); return this; }
public Event unmarshall(StaxUnmarshallerContext context) throws Exception { Event event = new Event(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; event.setSourceIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setSourceType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setMessage(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.withEventCategories(new ArrayList<String>()); continue; event.withEventCategories(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setSeverity(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setDate(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; event.setEventId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
event1.setEventId(UUID.randomUUID().toString()); event1.setEventName("Event1"); event2.setEventId(UUID.randomUUID().toString()); event2.setEventName("Event2");
ListIterator<Event> itr_attending =myUser.getAttendingList().listIterator(); // Below you are iterating while(itr_attending.hasNext()){ Event event = itr_attending.next(); int eventId = event.getEventId() // Or something like that based on event object if (myEvent.getId()==eventID){ itr_attending.remove(); } }
public Event unmarshall(StaxUnmarshallerContext context) throws Exception { Event event = new Event(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; event.setSourceIdentifier(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setSourceType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setMessage(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.withEventCategories(new ArrayList<String>()); continue; event.withEventCategories(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setSeverity(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; event.setDate(DateStaxUnmarshallerFactory.getInstance("iso8601").unmarshall(context)); continue; event.setEventId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
new String[] { String.valueOf(event.getEventId()) });
return false; Event other = (Event) obj; if (other.getSourceIdentifier() == null ^ this.getSourceIdentifier() == null) return false; if (other.getSourceIdentifier() != null && other.getSourceIdentifier().equals(this.getSourceIdentifier()) == false) return false; if (other.getSourceType() == null ^ this.getSourceType() == null) return false; if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getEventCategories() == null ^ this.getEventCategories() == null) return false; if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == false) return false; if (other.getSeverity() == null ^ this.getSeverity() == null) return false; if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == false) return false; if (other.getDate() == null ^ this.getDate() == null) return false; if (other.getDate() != null && other.getDate().equals(this.getDate()) == false) return false; if (other.getEventId() == null ^ this.getEventId() == null) return false; if (other.getEventId() != null && other.getEventId().equals(this.getEventId()) == false)
/** * <p> * The date and time of the event. * </p> * * @param date * The date and time of the event. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withDate(java.util.Date date) { setDate(date); return this; }
/** * <p> * The identifier of the event. * </p> * * @param eventId * The identifier of the event. * @return Returns a reference to this object so that method calls can be chained together. */ public Event withEventId(String eventId) { setEventId(eventId); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSourceIdentifier() != null) sb.append("SourceIdentifier: ").append(getSourceIdentifier()).append(","); if (getSourceType() != null) sb.append("SourceType: ").append(getSourceType()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getEventCategories() != null) sb.append("EventCategories: ").append(getEventCategories()).append(","); if (getSeverity() != null) sb.append("Severity: ").append(getSeverity()).append(","); if (getDate() != null) sb.append("Date: ").append(getDate()).append(","); if (getEventId() != null) sb.append("EventId: ").append(getEventId()); sb.append("}"); return sb.toString(); }
event.setDate(new Date()); event.setDescription("im rick james");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSourceIdentifier() == null) ? 0 : getSourceIdentifier().hashCode()); hashCode = prime * hashCode + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getEventCategories() == null) ? 0 : getEventCategories().hashCode()); hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode()); hashCode = prime * hashCode + ((getDate() == null) ? 0 : getDate().hashCode()); hashCode = prime * hashCode + ((getEventId() == null) ? 0 : getEventId().hashCode()); return hashCode; }
return false; Event other = (Event) obj; if (other.getSourceIdentifier() == null ^ this.getSourceIdentifier() == null) return false; if (other.getSourceIdentifier() != null && other.getSourceIdentifier().equals(this.getSourceIdentifier()) == false) return false; if (other.getSourceType() == null ^ this.getSourceType() == null) return false; if (other.getSourceType() != null && other.getSourceType().equals(this.getSourceType()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getEventCategories() == null ^ this.getEventCategories() == null) return false; if (other.getEventCategories() != null && other.getEventCategories().equals(this.getEventCategories()) == false) return false; if (other.getSeverity() == null ^ this.getSeverity() == null) return false; if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == false) return false; if (other.getDate() == null ^ this.getDate() == null) return false; if (other.getDate() != null && other.getDate().equals(this.getDate()) == false) return false; if (other.getEventId() == null ^ this.getEventId() == null) return false; if (other.getEventId() != null && other.getEventId().equals(this.getEventId()) == false)
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSourceIdentifier() != null) sb.append("SourceIdentifier: ").append(getSourceIdentifier()).append(","); if (getSourceType() != null) sb.append("SourceType: ").append(getSourceType()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getEventCategories() != null) sb.append("EventCategories: ").append(getEventCategories()).append(","); if (getSeverity() != null) sb.append("Severity: ").append(getSeverity()).append(","); if (getDate() != null) sb.append("Date: ").append(getDate()).append(","); if (getEventId() != null) sb.append("EventId: ").append(getEventId()); sb.append("}"); return sb.toString(); }