![JAR search and dependency download from the Maven repository](/logo.png)
com.github.alexmojaki.caseclasses.CaseClass Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of case-classes Show documentation
Show all versions of case-classes Show documentation
A framework to refactor computing a result from an aggregate object.
The newest version!
package com.github.alexmojaki.caseclasses;
/**
* An aggregate of multiple components (values with names)
* allowing various utilities to be applied concisely.
*/
public interface CaseClass {
/**
* Adds the components to the given {@link ResultBuilder}.
* To implement, repeatedly call {@code builder.add} with values
* that the object is composed of and a name of your choice.
* Avoid redundant values that can be computed from others.
* Since the builder returns itself, multiple calls can be chained.
* For example:
* {@code builder.add("name", name).add("age", age).add(...);}
*
* Note that adding a value to a builder exposes it as part of the
* class's interface, so if you don't want to have a public
* getter method for a value, you probably don't want to add it here.
*/
void buildResult(ResultBuilder builder);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy