Class BuildMemoryReport
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.diagnostics.BuildMemoryReport
-
- All Implemented Interfaces:
ModelObject
,Map<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
public class BuildMemoryReport extends Object implements Map<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>, ModelObject
Contains a snapshot clone of aBuildMemory
.- Author:
- Robert Sandell <rsandell@cloudbees.com>.
- See Also:
BuildMemory.report()
,Diagnostics
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<DateFormat>
TS_FORMAT
The format used to display timestamps.
-
Constructor Summary
Constructors Constructor Description BuildMemoryReport()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>>
entrySet()
List<BuildMemory.MemoryImprint.Entry>
get(Object key)
String
getDisplayName()
String
getDisplayNameFor(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Generates a one liner display name for the event.List<Map.Entry<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>>
getSortedEntrySet()
Gets a sorted list of the contents fromentrySet()
.boolean
isEmpty()
Set<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent>
keySet()
List<BuildMemory.MemoryImprint.Entry>
put(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent key, List<BuildMemory.MemoryImprint.Entry> value)
void
putAll(Map<? extends com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,? extends List<BuildMemory.MemoryImprint.Entry>> m)
List<BuildMemory.MemoryImprint.Entry>
remove(Object key)
int
size()
Collection<List<BuildMemory.MemoryImprint.Entry>>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
TS_FORMAT
public static final ThreadLocal<DateFormat> TS_FORMAT
The format used to display timestamps. A variant of ISO 8601 with the 'T' replaced by a space for simpler ocular parsing.
-
-
Method Detail
-
getSortedEntrySet
public List<Map.Entry<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>> getSortedEntrySet()
Gets a sorted list of the contents fromentrySet()
. The sorting is based on the inverse comparison ofGerritTriggeredEvent.getEventCreatedOn()
.- Returns:
- a sorted list of this report's entries.
-
getDisplayNameFor
public String getDisplayNameFor(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent event)
Generates a one liner display name for the event. ForChangeBasedEvent
s: "type change#/patchSet# @ timestamp". ForRefUpdated
events: "type project @ timestamp". Default: "type @ timestamp"- Parameters:
event
- the event- Returns:
- a name to display
-
size
public int size()
- Specified by:
size
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
get
public List<BuildMemory.MemoryImprint.Entry> get(Object key)
- Specified by:
get
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
put
public List<BuildMemory.MemoryImprint.Entry> put(com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent key, List<BuildMemory.MemoryImprint.Entry> value)
- Specified by:
put
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
remove
public List<BuildMemory.MemoryImprint.Entry> remove(Object key)
- Specified by:
remove
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
putAll
public void putAll(Map<? extends com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,? extends List<BuildMemory.MemoryImprint.Entry>> m)
- Specified by:
putAll
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
keySet
@NonNull public Set<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent> keySet()
- Specified by:
keySet
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
values
@NonNull public Collection<List<BuildMemory.MemoryImprint.Entry>> values()
- Specified by:
values
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
entrySet
@NonNull public Set<Map.Entry<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>> entrySet()
- Specified by:
entrySet
in interfaceMap<com.sonymobile.tools.gerrit.gerritevents.dto.events.GerritTriggeredEvent,List<BuildMemory.MemoryImprint.Entry>>
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
-