![JAR search and dependency download from the Maven repository](/logo.png)
com.github.alexmojaki.caseclasses.GetByNameBuilder 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;
class GetByNameBuilder extends AbstractResultBuilder {
static Object getValueByName(CaseClass obj, String name) {
GetByNameBuilder builder = new GetByNameBuilder();
builder.name = name;
obj.buildResult(builder);
return builder.value;
}
private String name;
private Object value;
@Override
protected void simpleAdd(String name, Object value) {
if (this.name.equals(name)) {
this.value = value;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy