Function bodies 391 total
slug method · java · L61-L63 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/CarModel.java
public String slug() {
return slug;
}relations method · java · L65-L67 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/CarModel.java
public List<ModelRelation> relations() {
return Collections.unmodifiableList(relations);
}requireNonBlank method · java · L69-L73 (5 LOC)src/main/java/live/yurii/autocatalog/domain/model/CarModel.java
private static String requireNonBlank(String v, String field) {
if (v == null || v.isBlank())
throw new IllegalArgumentException(field + " must not be blank");
return v.strip();
}slugify method · java · L75-L77 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/CarModel.java
private static String slugify(String name) {
return name.strip().toLowerCase().replaceAll("[^a-z0-9]+", "-");
}ModelId class · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelId.java
public record ModelId(UUID value) {
public ModelId {
Objects.requireNonNull(value, "ModelId value must not be null");
}
public static ModelId generate() {
return new ModelId(UUID.randomUUID());
}
public static ModelId of(String value) {
return new ModelId(UUID.fromString(value));
}
}ModelId function · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelId.java
public record ModelId(UUID value) {
public ModelId {
Objects.requireNonNull(value, "ModelId value must not be null");
}
public static ModelId generate() {
return new ModelId(UUID.randomUUID());
}
public static ModelId of(String value) {
return new ModelId(UUID.fromString(value));
}
}generate method · java · L11-L13 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelId.java
public static ModelId generate() {
return new ModelId(UUID.randomUUID());
}Source: Repobility analyzer · https://repobility.com
of method · java · L15-L17 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelId.java
public static ModelId of(String value) {
return new ModelId(UUID.fromString(value));
}ModelRelation class · java · L5-L30 (26 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelRelation.java
public class ModelRelation {
private final ModelId targetModelId;
private final Type type;
private final String note;
public ModelRelation(ModelId targetModelId, Type type, String note) {
this.targetModelId = Objects.requireNonNull(targetModelId);
this.type = Objects.requireNonNull(type);
this.note = note;
}
public ModelId targetModelId() {
return targetModelId;
}
public Type type() {
return type;
}
public String note() {
return note;
}
public enum Type {SUCCESSOR, PREDECESSOR, REBADGE, PLATFORM_SIBLING}
}ModelRelation method · java · L11-L15 (5 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelRelation.java
public ModelRelation(ModelId targetModelId, Type type, String note) {
this.targetModelId = Objects.requireNonNull(targetModelId);
this.type = Objects.requireNonNull(type);
this.note = note;
}targetModelId method · java · L17-L19 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelRelation.java
public ModelId targetModelId() {
return targetModelId;
}type method · java · L21-L23 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelRelation.java
public Type type() {
return type;
}note method · java · L25-L27 (3 LOC)src/main/java/live/yurii/autocatalog/domain/model/ModelRelation.java
public String note() {
return note;
}YearRange class · java · L3-L19 (17 LOC)src/main/java/live/yurii/autocatalog/domain/shared/YearRange.java
public record YearRange(int from, Integer to) {
public YearRange {
if (from < 1886) throw new IllegalArgumentException("No cars before 1886");
if (to != null && to < from) throw new IllegalArgumentException("'to' must be >= 'from'");
}
public boolean isCurrent() {
return to == null;
}
public boolean overlaps(YearRange other) {
int otherTo = other.to() != null ? other.to() : Integer.MAX_VALUE;
int thisTo = this.to != null ? this.to : Integer.MAX_VALUE;
return this.from <= otherTo && other.from() <= thisTo;
}
}YearRange function · java · L3-L19 (17 LOC)src/main/java/live/yurii/autocatalog/domain/shared/YearRange.java
public record YearRange(int from, Integer to) {
public YearRange {
if (from < 1886) throw new IllegalArgumentException("No cars before 1886");
if (to != null && to < from) throw new IllegalArgumentException("'to' must be >= 'from'");
}
public boolean isCurrent() {
return to == null;
}
public boolean overlaps(YearRange other) {
int otherTo = other.to() != null ? other.to() : Integer.MAX_VALUE;
int thisTo = this.to != null ? this.to : Integer.MAX_VALUE;
return this.from <= otherTo && other.from() <= thisTo;
}
}Repobility (the analyzer behind this table) · https://repobility.com
isCurrent method · java · L10-L12 (3 LOC)src/main/java/live/yurii/autocatalog/domain/shared/YearRange.java
public boolean isCurrent() {
return to == null;
}overlaps method · java · L14-L18 (5 LOC)src/main/java/live/yurii/autocatalog/domain/shared/YearRange.java
public boolean overlaps(YearRange other) {
int otherTo = other.to() != null ? other.to() : Integer.MAX_VALUE;
int thisTo = this.to != null ? this.to : Integer.MAX_VALUE;
return this.from <= otherTo && other.from() <= thisTo;
}TransmissionId function · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/TransmissionId.java
public record TransmissionId(UUID value) {
public TransmissionId {
Objects.requireNonNull(value, "TransmissionId value must not be null");
}
public static TransmissionId generate() {
return new TransmissionId(UUID.randomUUID());
}
public static TransmissionId of(String value) {
return new TransmissionId(UUID.fromString(value));
}
}TransmissionId class · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/TransmissionId.java
public record TransmissionId(UUID value) {
public TransmissionId {
Objects.requireNonNull(value, "TransmissionId value must not be null");
}
public static TransmissionId generate() {
return new TransmissionId(UUID.randomUUID());
}
public static TransmissionId of(String value) {
return new TransmissionId(UUID.fromString(value));
}
}generate method · java · L11-L13 (3 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/TransmissionId.java
public static TransmissionId generate() {
return new TransmissionId(UUID.randomUUID());
}of method · java · L15-L17 (3 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/TransmissionId.java
public static TransmissionId of(String value) {
return new TransmissionId(UUID.fromString(value));
}Transmission class · java · L5-L43 (39 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public class Transmission {
private TransmissionId id;
private TransmissionType type;
private int gearCount;
private Transmission() {
}
public static Transmission create(TransmissionType type, int gearCount) {
if (gearCount < 1 || gearCount > 12)
throw new IllegalArgumentException("Unexpected gear count: " + gearCount);
var t = new Transmission();
t.id = TransmissionId.generate();
t.type = Objects.requireNonNull(type);
t.gearCount = gearCount;
return t;
}
public static Transmission reconstitute(TransmissionId id, TransmissionType type, int gearCount) {
var t = new Transmission();
t.id = id;
t.type = type;
t.gearCount = gearCount;
return t;
}
public TransmissionId id() {
return id;
}
public TransmissionType type() {
return type;
}
public int gearCount() {
return gearCount;
}
}create method · java · L14-L22 (9 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public static Transmission create(TransmissionType type, int gearCount) {
if (gearCount < 1 || gearCount > 12)
throw new IllegalArgumentException("Unexpected gear count: " + gearCount);
var t = new Transmission();
t.id = TransmissionId.generate();
t.type = Objects.requireNonNull(type);
t.gearCount = gearCount;
return t;
}Powered by Repobility — scan your code at https://repobility.com
reconstitute method · java · L24-L30 (7 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public static Transmission reconstitute(TransmissionId id, TransmissionType type, int gearCount) {
var t = new Transmission();
t.id = id;
t.type = type;
t.gearCount = gearCount;
return t;
}id method · java · L32-L34 (3 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public TransmissionId id() {
return id;
}type method · java · L36-L38 (3 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public TransmissionType type() {
return type;
}gearCount method · java · L40-L42 (3 LOC)src/main/java/live/yurii/autocatalog/domain/transmission/Transmission.java
public int gearCount() {
return gearCount;
}VariantId class · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/variant/VariantId.java
public record VariantId(UUID value) {
public VariantId {
Objects.requireNonNull(value, "VariantId value must not be null");
}
public static VariantId generate() {
return new VariantId(UUID.randomUUID());
}
public static VariantId of(String value) {
return new VariantId(UUID.fromString(value));
}
}VariantId function · java · L6-L18 (13 LOC)src/main/java/live/yurii/autocatalog/domain/variant/VariantId.java
public record VariantId(UUID value) {
public VariantId {
Objects.requireNonNull(value, "VariantId value must not be null");
}
public static VariantId generate() {
return new VariantId(UUID.randomUUID());
}
public static VariantId of(String value) {
return new VariantId(UUID.fromString(value));
}
}generate method · java · L11-L13 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/VariantId.java
public static VariantId generate() {
return new VariantId(UUID.randomUUID());
}of method · java · L15-L17 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/VariantId.java
public static VariantId of(String value) {
return new VariantId(UUID.fromString(value));
}Repobility · code-quality intelligence · https://repobility.com
Variant class · java · L12-L117 (106 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public class Variant {
private VariantId id;
private BodyId bodyId;
private Set<EngineId> engineIds = new LinkedHashSet<>();
private TransmissionId transmissionId;
private Drivetrain drivetrain;
private Integer groundClearanceMm;
private int curbWeightKg;
private Integer systemPowerKw;
private Set<String> markets = new LinkedHashSet<>();
private Variant() {
}
public static Variant create(BodyId bodyId, TransmissionId transmissionId,
Drivetrain drivetrain, int curbWeightKg) {
if (curbWeightKg <= 0) throw new IllegalArgumentException("curbWeightKg must be > 0");
var v = new Variant();
v.id = VariantId.generate();
v.bodyId = Objects.requireNonNull(bodyId, "bodyId must not be null");
v.transmissionId = Objects.requireNonNull(transmissionId, "transmissionId must not be null");
v.drivetrain = Objects.requireNonNull(drivetrain, "drivetrain must not be null");
v.curbWeightKg = curbWeightKg;
return v;
}
create method · java · L27-L37 (11 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public static Variant create(BodyId bodyId, TransmissionId transmissionId,
Drivetrain drivetrain, int curbWeightKg) {
if (curbWeightKg <= 0) throw new IllegalArgumentException("curbWeightKg must be > 0");
var v = new Variant();
v.id = VariantId.generate();
v.bodyId = Objects.requireNonNull(bodyId, "bodyId must not be null");
v.transmissionId = Objects.requireNonNull(transmissionId, "transmissionId must not be null");
v.drivetrain = Objects.requireNonNull(drivetrain, "drivetrain must not be null");
v.curbWeightKg = curbWeightKg;
return v;
}reconstitute method · java · L39-L58 (20 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public static Variant reconstitute(VariantId id, BodyId bodyId,
Set<EngineId> engineIds,
TransmissionId transmissionId,
Drivetrain drivetrain,
Integer groundClearanceMm,
int curbWeightKg,
Integer systemPowerKw,
Set<String> markets) {
var v = new Variant();
v.id = id;
v.bodyId = bodyId;
v.engineIds = new LinkedHashSet<>(engineIds);
v.transmissionId = transmissionId;
v.drivetrain = drivetrain;
v.groundClearanceMm = groundClearanceMm;
v.curbWeightKg = curbWeightKg;
v.systemPowerKw = systemPowerKw;
v.markets = new LinkedHashSet<>(markets);
return v;
}addEngine method · java · L60-L62 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public void addEngine(EngineId engineId) {
engineIds.add(Objects.requireNonNull(engineId, "engineId must not be null"));
}addMarket method · java · L64-L68 (5 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public void addMarket(String market) {
if (market == null || market.isBlank())
throw new IllegalArgumentException("market must not be blank");
markets.add(market.toUpperCase().strip());
}setGroundClearanceMm method · java · L70-L74 (5 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public void setGroundClearanceMm(int groundClearanceMm) {
if (groundClearanceMm <= 0)
throw new IllegalArgumentException("groundClearanceMm must be > 0");
this.groundClearanceMm = groundClearanceMm;
}setSystemPowerKw method · java · L76-L80 (5 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public void setSystemPowerKw(int systemPowerKw) {
if (systemPowerKw <= 0)
throw new IllegalArgumentException("systemPowerKw must be > 0");
this.systemPowerKw = systemPowerKw;
}id method · java · L82-L84 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public VariantId id() {
return id;
}Source: Repobility analyzer · https://repobility.com
bodyId method · java · L86-L88 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public BodyId bodyId() {
return bodyId;
}engineIds method · java · L90-L92 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public Set<EngineId> engineIds() {
return Collections.unmodifiableSet(engineIds);
}transmissionId method · java · L94-L96 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public TransmissionId transmissionId() {
return transmissionId;
}drivetrain method · java · L98-L100 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public Drivetrain drivetrain() {
return drivetrain;
}groundClearanceMm method · java · L102-L104 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public Integer groundClearanceMm() {
return groundClearanceMm;
}curbWeightKg method · java · L106-L108 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public int curbWeightKg() {
return curbWeightKg;
}systemPowerKw method · java · L110-L112 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public Integer systemPowerKw() {
return systemPowerKw;
}markets method · java · L114-L116 (3 LOC)src/main/java/live/yurii/autocatalog/domain/variant/Variant.java
public Set<String> markets() {
return Collections.unmodifiableSet(markets);
}Repobility (the analyzer behind this table) · https://repobility.com
ApplicationConfig class · java · L21-L63 (43 LOC)src/main/java/live/yurii/autocatalog/infrastructure/config/ApplicationConfig.java
public class ApplicationConfig {
@Bean
public MakeService makeService(MakeRepository makeRepository) {
return new MakeService(makeRepository);
}
@Bean
public CarModelService carModelService(CarModelRepository modelRepository,
MakeRepository makeRepository) {
return new CarModelService(modelRepository, makeRepository);
}
@Bean
public EngineService engineService(EngineRepository engineRepository) {
return new EngineService(engineRepository);
}
@Bean
public TransmissionService transmissionService(TransmissionRepository transmissionRepository) {
return new TransmissionService(transmissionRepository);
}
@Bean
public GenerationService generationService(GenerationRepository generationRepository,
CarModelRepository modelRepository) {
return new GenerationService(generationRepository, modelRepository);
}
@Bean
public BodyService bodyService(BodyReposimakeService method · java · L24-L26 (3 LOC)src/main/java/live/yurii/autocatalog/infrastructure/config/ApplicationConfig.java
public MakeService makeService(MakeRepository makeRepository) {
return new MakeService(makeRepository);
}carModelService method · java · L29-L32 (4 LOC)src/main/java/live/yurii/autocatalog/infrastructure/config/ApplicationConfig.java
public CarModelService carModelService(CarModelRepository modelRepository,
MakeRepository makeRepository) {
return new CarModelService(modelRepository, makeRepository);
}