if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getEventId() != null) sb.append("EventId: ").append(getEventId()).append(","); if (getStackName() != null) sb.append("StackName: ").append(getStackName()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getEventId() == null) ? 0 : getEventId().hashCode()); hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode()); hashCode = prime * hashCode + ((getLogicalResourceId() == null) ? 0 : getLogicalResourceId().hashCode()); hashCode = prime * hashCode + ((getPhysicalResourceId() == null) ? 0 : getPhysicalResourceId().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getResourceStatus() == null) ? 0 : getResourceStatus().hashCode()); hashCode = prime * hashCode + ((getResourceStatusReason() == null) ? 0 : getResourceStatusReason().hashCode()); hashCode = prime * hashCode + ((getResourceProperties() == null) ? 0 : getResourceProperties().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); return hashCode; }
if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getEventId() == null ^ this.getEventId() == null) return false; if (other.getEventId() != null && other.getEventId().equals(this.getEventId()) == false) return false; if (other.getStackName() == null ^ this.getStackName() == null)
if (getStackId() != null) sb.append("StackId: ").append(getStackId()).append(","); if (getEventId() != null) sb.append("EventId: ").append(getEventId()).append(","); if (getStackName() != null) sb.append("StackName: ").append(getStackName()).append(",");
List<StackEvent> stackEvents = new ArrayList<>(); for (StackEvent event : result.getStackEvents()) { if (event.getEventId().equals(lastEventId) || event.getTimestamp().before(startDate)) { break; this.printLine(); lastEventId = stackEvents.get(stackEvents.size() - 1).getEventId();
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); hashCode = prime * hashCode + ((getEventId() == null) ? 0 : getEventId().hashCode()); hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode()); hashCode = prime * hashCode + ((getLogicalResourceId() == null) ? 0 : getLogicalResourceId().hashCode()); hashCode = prime * hashCode + ((getPhysicalResourceId() == null) ? 0 : getPhysicalResourceId().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); hashCode = prime * hashCode + ((getResourceStatus() == null) ? 0 : getResourceStatus().hashCode()); hashCode = prime * hashCode + ((getResourceStatusReason() == null) ? 0 : getResourceStatusReason().hashCode()); hashCode = prime * hashCode + ((getResourceProperties() == null) ? 0 : getResourceProperties().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); return hashCode; }
private void printStackEvents() { DescribeStackEventsRequest r = new DescribeStackEventsRequest(); r.withStackName(getExpandedStackName()); DescribeStackEventsResult describeStackEvents = amazonClient.describeStackEvents(r); List<StackEvent> stackEvents = describeStackEvents.getStackEvents(); Collections.reverse(stackEvents); for (StackEvent event : stackEvents) { logger.println(event.getEventId() + " - " + event.getResourceType() + " - " + event.getResourceStatus() + " - " + event.getResourceStatusReason()); } }
new TreeSet<>( (o1, o2) -> { return o1.getEventId().compareTo(o2.getEventId()); });
private void printEvents(List<StackEvent> stackEvents) { if (printedEvents.isEmpty()) { getLogger().info("==== Events ===="); } stackEvents.stream() .forEach(o -> { String eventId = o.getEventId(); // If we haven't printed the event, then print it and add to list of printed events so we won't print again if (!printedEvents.contains(eventId)) { getLogger().info("{} {} {}: {} {}", o.getTimestamp(), o.getResourceStatus(), o.getResourceType(), o.getLogicalResourceId(), (o.getResourceStatusReason() == null) ? "" : o.getResourceStatusReason()); printedEvents.add(eventId); } }); }
if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; if (other.getEventId() == null ^ this.getEventId() == null) return false; if (other.getEventId() != null && other.getEventId().equals(this.getEventId()) == false) return false; if (other.getStackName() == null ^ this.getStackName() == null)