BrightSide Workbench Full Report + Source Code
org.turro.cleanup.Cleanup Class Reference

Static Public Member Functions

static List< IElephantCleanupgetFor (Object entity, ICleanupConsole console)
 
static void executeForEntity (Object entity, ICleanupConsole console, CleanupMode mode)
 
static void executeForCommons (String entityPath, ICleanupConsole console, CleanupMode mode, Set< IElephantCleanup.Commons > commons)
 
static void orphans ()
 
static Set< String > getEntityPathsFor (String root, IElephantCleanup.Commons common)
 

Detailed Description

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

Definition at line 32 of file Cleanup.java.

Member Function Documentation

◆ executeForCommons()

static void org.turro.cleanup.Cleanup.executeForCommons ( String  entityPath,
ICleanupConsole  console,
CleanupMode  mode,
Set< IElephantCleanup.Commons >  commons 
)
static

Definition at line 49 of file Cleanup.java.

49  {
50  if(Path.pathFrom(entityPath).getSize() != 2) return; // Not an entityPath
51  Instances.fresh().byAnnotation(ElephantCleanup.class, IElephantCleanup.class)
52  .stream()
53  .forEach(cleanup -> {
54  WebLoggers.info(cleanup).message("From commons started...").log();
55  cleanup.setConsole(console);
56  cleanup.cleanFromCommons(entityPath, mode, commons);
57  WebLoggers.info(cleanup).message("From commons ended...").log();
58  });
59  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeForEntity()

static void org.turro.cleanup.Cleanup.executeForEntity ( Object  entity,
ICleanupConsole  console,
CleanupMode  mode 
)
static

Definition at line 40 of file Cleanup.java.

40  {
41  Instances.fresh().byAnnotation(ElephantCleanup.class, IElephantCleanup.class)
42  .stream().filter(cleanup -> cleanup.isMine(entity))
43  .forEach(cleanup -> {
44  cleanup.setConsole(console);
45  cleanup.cleanEntity(entity, mode);
46  });
47  }

◆ getEntityPathsFor()

static Set<String> org.turro.cleanup.Cleanup.getEntityPathsFor ( String  root,
IElephantCleanup.Commons  common 
)
static

Definition at line 70 of file Cleanup.java.

70  {
71  return Instances.fresh().byAnnotation(ElephantCleanup.class, IElephantCleanup.class)
72  .stream().flatMap(cleanup -> cleanup.pathsForRoot(root, common).stream())
73  .collect(Collectors.toSet());
74  }
Here is the caller graph for this function:

◆ getFor()

static List<IElephantCleanup> org.turro.cleanup.Cleanup.getFor ( Object  entity,
ICleanupConsole  console 
)
static

Definition at line 34 of file Cleanup.java.

34  {
35  return Instances.fresh().byAnnotation(ElephantCleanup.class, IElephantCleanup.class)
36  .stream().filter(cleanup -> cleanup.isMine(entity))
37  .peek(cleanup -> cleanup.setConsole(console)).toList();
38  }
Here is the caller graph for this function:

◆ orphans()

static void org.turro.cleanup.Cleanup.orphans ( )
static

Definition at line 61 of file Cleanup.java.

61  {
62  Instances.fresh().byAnnotation(ElephantCleanup.class, IElephantCleanup.class)
63  .stream().forEach(cleanup -> {
64  WebLoggers.info(cleanup).message("Orphans started...").log();
65  cleanup.cleanOrphans();
66  WebLoggers.info(cleanup).message("Orphans ended...").log();
67  });
68  }
Here is the call graph for this function:
Here is the caller graph for this function:

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