add SEPA-Mandate entity+repository
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package net.hostsharing.hsadminng;
|
||||
|
||||
import net.hostsharing.hsadminng.errors.DisplayName;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -28,7 +30,16 @@ public final class Stringify<B> {
|
||||
|
||||
private Stringify(final Class<B> clazz, final String name) {
|
||||
this.clazz = clazz;
|
||||
this.name = name;
|
||||
if (name != null) {
|
||||
this.name = name;
|
||||
} else {
|
||||
final var displayName = clazz.getAnnotation(DisplayName.class);
|
||||
if (displayName != null) {
|
||||
this.name = displayName.value();
|
||||
} else {
|
||||
this.name = clazz.getSimpleName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Stringify<B> withProp(final String propName, final Function<B, ?> getter) {
|
||||
@ -53,7 +64,7 @@ public final class Stringify<B> {
|
||||
})
|
||||
.map(propVal -> propName(propVal, "=") + optionallyQuoted(propVal))
|
||||
.collect(Collectors.joining(separator));
|
||||
return (name != null ? name : object.getClass().getSimpleName()) + "(" + propValues + ")";
|
||||
return name + "(" + propValues + ")";
|
||||
}
|
||||
|
||||
public Stringify<B> withSeparator(final String separator) {
|
||||
|
@ -7,6 +7,7 @@ import net.hostsharing.hsadminng.Stringifyable;
|
||||
import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity;
|
||||
import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity;
|
||||
import net.hostsharing.hsadminng.hs.office.partner.HsOfficePartnerEntity;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.UUID;
|
||||
|
Reference in New Issue
Block a user