BrightSide Workbench Full Report + Source Code
org.turro.phase.PhaseDefinitions Class Reference
Inheritance diagram for org.turro.phase.PhaseDefinitions:
Collaboration diagram for org.turro.phase.PhaseDefinitions:

Public Member Functions

PhaseDefinition get (int index)
 
PhaseDefinition get (String name)
 
int getMapping (int index, String serverId)
 

Static Public Member Functions

static PhaseDefinitions instance ()
 
static void reset ()
 

Static Protected Member Functions

static PhaseDefinitions load ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 39 of file PhaseDefinitions.java.

Member Function Documentation

◆ get() [1/2]

PhaseDefinition org.turro.phase.PhaseDefinitions.get ( int  index)

Definition at line 41 of file PhaseDefinitions.java.

41  {
42  return stream().filter(pd -> pd.getIndex() == index).findFirst().orElse(null);
43  }
Here is the caller graph for this function:

◆ get() [2/2]

PhaseDefinition org.turro.phase.PhaseDefinitions.get ( String  name)

Definition at line 45 of file PhaseDefinitions.java.

45  {
46  return stream().filter(pd -> pd.getName().equals(name)).findFirst().orElse(null);
47  }

◆ getMapping()

int org.turro.phase.PhaseDefinitions.getMapping ( int  index,
String  serverId 
)

Definition at line 49 of file PhaseDefinitions.java.

49  {
50  PhaseDefinition pd = get(index);
51  if(pd == null) return index;
52  return pd.getMapping().getOrDefault(serverId, index);
53  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

static PhaseDefinitions org.turro.phase.PhaseDefinitions.instance ( )
static

Definition at line 132 of file PhaseDefinitions.java.

132  {
133  return INIT.instance(() -> !watch.isNewer(), () -> load());
134  }
static PhaseDefinitions load()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

static PhaseDefinitions org.turro.phase.PhaseDefinitions.load ( )
staticprotected

Definition at line 142 of file PhaseDefinitions.java.

142  {
143  PhaseDefinitions definitions = null;
144  if(watch.exists()) try {
145  watch.reset();
146  JSONSerializer ser = new JSONSerializer(true);
147  definitions = ser.fromJson(FileUtil.getContent(watch.getFile()), PhaseDefinitions.class);
148  } catch (IOException ex) {
149  Logger.getLogger(PhaseDefinitions.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
150  }
151  if(definitions == null) {
152  definitions = new PhaseDefinitions();
153  definitions.setDefaults();
154  save(definitions);
155  }
156  return definitions;
157  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

static void org.turro.phase.PhaseDefinitions.reset ( )
static

Definition at line 136 of file PhaseDefinitions.java.

136  {
137  INIT.reset();
138  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: