Develop#1
Merged
Merged
Conversation
…Twitter's algorithm
…for managing business object lifecycle
…jectReflector for factory method resolution
…olution and context propagation
…r field tracking and management
…ibility and clarity
…ty and functionality
…ity and readability
…eflector for improved clarity
…rt Supplier with priority
…tations and improve object creation logic
… constructor signatures
…p and Semaphore for thread-safe property registration and retrieval
…BypassRuleCheckObject
…ss object functionality
…tArgs for event handling
… enhance Rules class with running rules management
…tation and understanding of validation rule management
…lidation rule implementation
…ode annotation to RuleCheckException
…d AuditStore interface
There was a problem hiding this comment.
Pull request overview
This PR introduces a new multi-module Java codebase for the Euonia framework, adding foundational utilities (core), domain model primitives (domain), and an OSBA layer (osba), plus a standalone Spring Boot sample app and repository hygiene files.
Changes:
- Adds new Maven parent +
core,domain, andosbamodules with initial implementations (tuples, IDs, reflection helpers, rules, events, security, HTTP exceptions). - Adds extensive JUnit 5 test coverage for the new
coreutilities. - Adds a
sampleSpring Boot application (separate from the multi-module build) plus basic config and Maven wrapper files.
Reviewed changes
Copilot reviewed 152 out of 153 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| sample/src/test/java/com/euonia/sample/SampleApplicationTests.java | Adds Spring Boot smoke test for sample app context startup. |
| sample/src/main/resources/application.yaml | Adds minimal Spring Boot application config (app name). |
| sample/src/main/java/com/euonia/sample/SampleApplication.java | Adds sample Spring Boot application entry point. |
| sample/src/main/java/com/euonia/sample/domain/package-info.java | Adds sample domain package marker. |
| sample/src/main/java/com/euonia/sample/domain/aggregate/User.java | Adds sample domain aggregate User. |
| sample/pom.xml | Adds standalone Maven build for the sample Spring Boot app. |
| sample/.mvn/wrapper/maven-wrapper.properties | Adds Maven wrapper distribution configuration for sample app. |
| sample/.gitignore | Adds sample-module ignore rules (IDE/build output). |
| sample/.gitattributes | Adds sample-module EOL settings for wrapper scripts. |
| pom.xml | Adds repository Maven parent POM defining core, osba, domain modules. |
| osba/src/main/java/com/euonia/reflection/PropertyInfoManager.java | Adds property metadata cache/registration entry points. |
| osba/src/main/java/com/euonia/reflection/PropertyInfoList.java | Adds property list container with a semaphore-guarded getOrAdd. |
| osba/src/main/java/com/euonia/reflection/PropertyInfo.java | Adds property metadata model (type/name/default/display-name integration). |
| osba/src/main/java/com/euonia/reflection/MissingMethodException.java | Adds reflection helper exception for missing convention-based method discovery. |
| osba/src/main/java/com/euonia/reflection/FieldDataManager.java | Adds field/property consolidation and static field initialization helper. |
| osba/src/main/java/com/euonia/reflection/FieldData.java | Adds tracked field wrapper with change history and undo support. |
| osba/src/main/java/com/euonia/reflection/AmbiguousMethodException.java | Adds reflection helper exception for ambiguous method matches. |
| osba/src/main/java/com/euonia/osba/SavedEventArgs.java | Adds saved-event payload type for EditableObject notifications. |
| osba/src/main/java/com/euonia/osba/rules/RuleSeverity.java | Adds severity enum for rule evaluation outcomes. |
| osba/src/main/java/com/euonia/osba/rules/RuleResult.java | Adds rule execution result model (success/severity/description/properties). |
| osba/src/main/java/com/euonia/osba/rules/RuleManager.java | Adds per-type rule manager registry and initialization state tracking. |
| osba/src/main/java/com/euonia/osba/rules/RuleContext.java | Adds rule execution context and result aggregation. |
| osba/src/main/java/com/euonia/osba/rules/RuleCheckException.java | Adds exception for failed rule checks with HTTP status annotation. |
| osba/src/main/java/com/euonia/osba/rules/RuleBase.java | Adds base class for rules (name generation, default priority). |
| osba/src/main/java/com/euonia/osba/rules/Rule.java | Adds rule interface contract (priority + async execution). |
| osba/src/main/java/com/euonia/osba/rules/RequiredRule.java | Adds required-value validation rule implementation. |
| osba/src/main/java/com/euonia/osba/rules/RegularRule.java | Adds regex-based validation rule implementation. |
| osba/src/main/java/com/euonia/osba/rules/LambdaRule.java | Adds lambda-based validation rule implementation. |
| osba/src/main/java/com/euonia/osba/rules/DataAnnotationRule.java | Adds annotation-driven validation rule implementation. |
| osba/src/main/java/com/euonia/osba/rules/BrokenRuleCollection.java | Adds synchronized collection for broken rule storage/querying. |
| osba/src/main/java/com/euonia/osba/rules/BrokenRule.java | Adds broken rule record (property/description/severity). |
| osba/src/main/java/com/euonia/osba/ReadOnlyObject.java | Adds read-only business object base type. |
| osba/src/main/java/com/euonia/osba/ObjectEditState.java | Adds edit-state enum for business object lifecycle tracking. |
| osba/src/main/java/com/euonia/osba/ExecutableObject.java | Adds executable business object base type hooks. |
| osba/src/main/java/com/euonia/osba/EditableObject.java | Adds save workflow + saved-event publishing + rule check integration. |
| osba/src/main/java/com/euonia/osba/BusinessContext.java | Adds business context for object creation and factory access. |
| osba/src/main/java/com/euonia/osba/abstracts/UseBusinessContext.java | Adds interface for business-context propagation. |
| osba/src/main/java/com/euonia/osba/abstracts/TrackableObject.java | Adds object state tracking contract. |
| osba/src/main/java/com/euonia/osba/abstracts/Savable.java | Adds save contract for savable business objects. |
| osba/src/main/java/com/euonia/osba/abstracts/RuleCheckable.java | Adds contract for rule checking + broken rule access. |
| osba/src/main/java/com/euonia/osba/abstracts/OperableProperty.java | Adds contract for property get/set via PropertyInfo. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryUpdate.java | Adds factory annotation for update operations. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryInsert.java | Adds factory annotation for insert operations. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryFetch.java | Adds factory annotation for fetch operations. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryExecute.java | Adds factory annotation for execute operations. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryDelete.java | Adds factory annotation for delete operations. |
| osba/src/main/java/com/euonia/factory/annotation/FactoryCreate.java | Adds factory annotation for create operations. |
| osba/pom.xml | Adds Maven module definition for osba. |
| domain/src/main/java/com/euonia/domain/ValueObject.java | Adds reflective value-object base (equals/hashCode/compareTo). |
| domain/src/main/java/com/euonia/domain/event/EventBase.java | Adds base event implementation with metadata properties. |
| domain/src/main/java/com/euonia/domain/event/EventAggregate.java | Adds persistence/transport aggregate representation of events. |
| domain/src/main/java/com/euonia/domain/event/Event.java | Adds event interface contract. |
| domain/src/main/java/com/euonia/domain/event/DomainEventBase.java | Adds domain-event base with aggregate attachment + conversion to EventAggregate. |
| domain/src/main/java/com/euonia/domain/event/DomainEvent.java | Adds domain-event interface contract. |
| domain/src/main/java/com/euonia/domain/event/ApplicationEventBase.java | Adds application-event base type. |
| domain/src/main/java/com/euonia/domain/event/ApplicationEvent.java | Adds application-event interface contract. |
| domain/src/main/java/com/euonia/domain/EntityBase.java | Adds base entity implementation with ID + keys + toString. |
| domain/src/main/java/com/euonia/domain/Entity.java | Adds entity interface contract. |
| domain/src/main/java/com/euonia/domain/auditing/AuditStore.java | Adds audit storage SPI. |
| domain/src/main/java/com/euonia/domain/auditing/AuditRecord.java | Adds audit record entity model. |
| domain/src/main/java/com/euonia/domain/auditing/Audited.java | Adds auditing marker annotation. |
| domain/src/main/java/com/euonia/domain/AggregateBase.java | Adds aggregate base with domain-event queueing/attachment. |
| domain/src/main/java/com/euonia/domain/Aggregate.java | Adds aggregate interface contract. |
| domain/pom.xml | Adds Maven module definition for domain. |
| core/src/test/java/com/euonia/tuple/TupleDefaultMethodsTest.java | Adds tests for tuple default behaviors (contains/toList/indexOf/etc.). |
| core/src/test/java/com/euonia/tuple/TrioTest.java | Adds Trio tuple tests. |
| core/src/test/java/com/euonia/tuple/SoloTest.java | Adds Solo tuple tests. |
| core/src/test/java/com/euonia/tuple/SextetTest.java | Adds Sextet tuple tests. |
| core/src/test/java/com/euonia/tuple/SeptetTest.java | Adds Septet tuple tests. |
| core/src/test/java/com/euonia/tuple/QuintetTest.java | Adds Quintet tuple tests. |
| core/src/test/java/com/euonia/tuple/QuartetTest.java | Adds Quartet tuple tests. |
| core/src/test/java/com/euonia/tuple/OctetTest.java | Adds Octet tuple tests. |
| core/src/test/java/com/euonia/tuple/NonetTest.java | Adds Nonet tuple tests. |
| core/src/test/java/com/euonia/tuple/DuetTest.java | Adds Duet tuple tests. |
| core/src/test/java/com/euonia/tuple/DecetTest.java | Adds Decet tuple tests. |
| core/src/test/java/com/euonia/security/UserPrincipalTest.java | Adds tests for UserPrincipal auth/role checks and error cases. |
| core/src/test/java/com/euonia/security/UserClaimTypesTest.java | Adds tests for claim constants and reflection constraints. |
| core/src/test/java/com/euonia/security/CredentialExceptionTest.java | Adds tests for credential exception constructors and immutable details behavior. |
| core/src/test/java/com/euonia/security/AuthExceptionsTest.java | Adds tests for authentication/authorization exception constructors. |
| core/src/test/java/com/euonia/security/AccountExceptionTest.java | Adds tests for account exception constructors and immutable details behavior. |
| core/src/test/java/com/euonia/reflection/TypeHelperTest.java | Adds tests for type coercion utility across primitives/enum/time/collections. |
| core/src/test/java/com/euonia/reflection/GenericTypeTest.java | Adds tests for generic type capture wrapper. |
| core/src/test/java/com/euonia/reflection/DisplayNameTest.java | Adds tests for @DisplayName reflection annotation definition and usage. |
| core/src/test/java/com/euonia/http/ResponseHttpStatusCodeTest.java | Adds tests for HTTP status annotation metadata. |
| core/src/test/java/com/euonia/http/HttpStatusExceptionTest.java | Adds tests for HttpStatusException constructors. |
| core/src/test/java/com/euonia/http/HttpDerivedExceptionsTest.java | Adds parameterized tests for derived HTTP exceptions status/message/cause. |
| core/src/test/java/com/euonia/core/ULIDTest.java | Adds tests for ULID format/uniqueness. |
| core/src/test/java/com/euonia/core/SnowflakeIdTest.java | Adds tests for Snowflake ID generation and bounds checking. |
| core/src/test/java/com/euonia/core/SingletonTest.java | Adds tests for singleton caching + error behavior without default ctor. |
| core/src/test/java/com/euonia/core/ShortUniqueIdTest.java | Adds tests for ShortUniqueId encode/decode behaviors and validation. |
| core/src/test/java/com/euonia/core/PriorityValueFinderTest.java | Adds tests for prioritized value selection. |
| core/src/test/java/com/euonia/core/PairTest.java | Adds tests for Pair creation and null-key validation. |
| core/src/test/java/com/euonia/core/ObjectIdTest.java | Adds tests for ObjectId construction, factories, equals/hashCode, toString. |
| core/src/test/java/com/euonia/annotation/ValidationAnnotationTest.java | Adds tests for @Validation meta-annotation. |
| core/src/test/java/com/euonia/annotation/RequiredValidatorTest.java | Adds tests for required validator edge cases and custom message. |
| core/src/test/java/com/euonia/annotation/RequiredAnnotationTest.java | Adds tests for required annotation metadata/defaults. |
| core/src/main/java/com/euonia/tuple/Trio.java | Adds Trio tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Solo.java | Adds Solo tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Sextet.java | Adds Sextet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Septet.java | Adds Septet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Quintet.java | Adds Quintet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Quartet.java | Adds Quartet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Octet.java | Adds Octet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Nonet.java | Adds Nonet tuple record implementation. |
| core/src/main/java/com/euonia/tuple/Duet.java | Adds Duet tuple record implementation. |
| core/src/main/java/com/euonia/security/UserPrincipal.java | Adds subject-backed principal helper for name/auth/role checks. |
| core/src/main/java/com/euonia/security/UserClaimTypes.java | Adds OIDC-oriented claim type constants. |
| core/src/main/java/com/euonia/security/UnauthorizedAccessException.java | Adds authorization exception type. |
| core/src/main/java/com/euonia/security/CredentialException.java | Adds base credential exception type with (currently immutable) details map. |
| core/src/main/java/com/euonia/security/AuthenticationException.java | Adds authentication exception type. |
| core/src/main/java/com/euonia/security/AccountException.java | Adds base account exception type with (currently immutable) details map. |
| core/src/main/java/com/euonia/reflection/GenericType.java | Adds runtime generic type capture helper. |
| core/src/main/java/com/euonia/reflection/DisplayName.java | Adds field display-name annotation for UI/messages. |
| core/src/main/java/com/euonia/http/UpgradeRequiredException.java | Adds HTTP 426 exception type. |
| core/src/main/java/com/euonia/http/TooManyRequestsException.java | Adds HTTP 429 exception type. |
| core/src/main/java/com/euonia/http/ServiceUnavailableException.java | Adds HTTP 503 exception type. |
| core/src/main/java/com/euonia/http/ResponseHttpStatusCode.java | Adds HTTP status annotation for exception-to-status mapping. |
| core/src/main/java/com/euonia/http/ResourceNotFoundException.java | Adds HTTP 404 exception type. |
| core/src/main/java/com/euonia/http/RequestTimeoutException.java | Adds HTTP 408 exception type. |
| core/src/main/java/com/euonia/http/MethodNotAllowedException.java | Adds HTTP 405 exception type. |
| core/src/main/java/com/euonia/http/InternalServerErrorException.java | Adds HTTP 500 exception type. |
| core/src/main/java/com/euonia/http/HttpStatusException.java | Adds base HTTP status exception with status code storage. |
| core/src/main/java/com/euonia/http/GatewayTimeoutException.java | Adds HTTP 504 exception type. |
| core/src/main/java/com/euonia/http/ForbiddenException.java | Adds HTTP 403 exception type. |
| core/src/main/java/com/euonia/http/ConflictException.java | Adds HTTP 409 exception type. |
| core/src/main/java/com/euonia/http/BadRequestException.java | Adds HTTP 400 exception type. |
| core/src/main/java/com/euonia/http/BadGatewayException.java | Adds HTTP 502 exception type. |
| core/src/main/java/com/euonia/core/ULID.java | Adds ULID generator utility implementation. |
| core/src/main/java/com/euonia/core/SnowflakeId.java | Adds Snowflake ID generator implementation. |
| core/src/main/java/com/euonia/core/Singleton.java | Adds class-keyed singleton cache helper. |
| core/src/main/java/com/euonia/core/PriorityValueFinder.java | Adds utility for selecting values by priority and predicate. |
| core/src/main/java/com/euonia/core/PriorityQueue.java | Adds simple priority queue wrapper over java.util.PriorityQueue. |
| core/src/main/java/com/euonia/core/Pair.java | Adds Pair record type with null-key validation helper. |
| core/src/main/java/com/euonia/core/ObjectId.java | Adds polymorphic object ID wrapper + factory methods. |
| core/src/main/java/com/euonia/annotation/Validator.java | Adds validator SPI for annotation-driven validation. |
| core/src/main/java/com/euonia/annotation/Validation.java | Adds meta-annotation for binding annotations to validators. |
| core/src/main/java/com/euonia/annotation/RequiredValidator.java | Adds validator implementation for @Required. |
| core/src/main/java/com/euonia/annotation/Required.java | Adds required-value annotation definition. |
| core/pom.xml | Adds Maven module definition for core including JUnit 5 + Surefire. |
| .gitignore | Expands repository ignore rules for IDE/temp files. |
| .editorconfig | Adds repository-wide formatting rules (indentation, EOL, trimming). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
+36
| @Override | ||
| public EventAggregate getEventAggregate() { | ||
| return new EventAggregate() {{ | ||
| setId(ObjectId.guid().toString()); | ||
| setTypeName(getClass().getTypeName()); | ||
| setEventIntent(getEventIntent()); | ||
| setEventId(getEventId()); | ||
| setTimestamp(Instant.now()); | ||
| setOriginatorId(getOriginatorId()); | ||
| setOriginatorType(getOriginatorType()); | ||
| setEventSequence(getSequence()); | ||
| setAggregatePayload(this); | ||
| }}; | ||
| } |
Comment on lines
+52
to
+55
| if (aggregatePayload.getClass().isAssignableFrom(type)) { | ||
| return (A) aggregatePayload; | ||
| } | ||
| return null; |
Comment on lines
+32
to
+47
| public PropertyInfo<?> getOrAdd(PropertyInfo<?> propertyInfo) { | ||
| try { | ||
| semaphore.acquire(); | ||
| var existing = this.stream().filter(p -> p.getName().equals(propertyInfo.getName())).findFirst().orElse(null); | ||
| if (existing != null) { | ||
| return existing; | ||
| } | ||
| this.add(propertyInfo); | ||
| return propertyInfo; | ||
| } catch (InterruptedException e) { | ||
| Thread.currentThread().interrupt(); | ||
| throw new RuntimeException("Thread was interrupted while trying to acquire semaphore.", e); | ||
| } finally { | ||
| semaphore.release(); | ||
| } | ||
| } |
Comment on lines
+61
to
+71
| public void setValue(T value) { | ||
| if (this.value == null && value == null) { | ||
| return; | ||
| } | ||
|
|
||
| if (Objects.equals(this.value, value)) { | ||
| return; | ||
| } | ||
| this.value = value; | ||
| ((SubmissionPublisher<T>) publisher).submit(this.value); | ||
| } |
Comment on lines
+131
to
+140
| for (var field : fields) { | ||
| if (field.getModifiers() == java.lang.reflect.Modifier.STATIC) { | ||
| field.setAccessible(true); | ||
| try { | ||
| field.get(null); | ||
| } catch (IllegalAccessException e) { | ||
| // | ||
| } | ||
| } | ||
| } |
Comment on lines
+10
to
+16
| public static PropertyInfoList getPropertyListCache(Type type) { | ||
| return propertyCache.computeIfAbsent(type, t -> { | ||
| PropertyInfoList propertyInfoList = new PropertyInfoList(); | ||
| FieldDataManager.initStaticFields((Class<?>) t); | ||
| return propertyInfoList; | ||
| }); | ||
| } |
Comment on lines
+75
to
+95
| /** | ||
| * Set additional details related to the credential exception. This can be used to provide more context about the error, such as which field was invalid or what the expected format was. | ||
| * | ||
| * @param key The key for the detail. | ||
| * @param value The value for the detail. | ||
| */ | ||
| public void set(String key, Object value) { | ||
| details.put(key, value); | ||
| } | ||
|
|
||
| /** | ||
| * Set additional details related to the credential exception. This can be used to provide more context about the error, such as which field was invalid or what the expected format was. | ||
| * | ||
| * @param key The key for the detail. | ||
| * @param value The value for the detail. | ||
| * @return The CredentialException instance, allowing for method chaining. | ||
| */ | ||
| public CredentialException with(String key, Object value) { | ||
| details.put(key, value); | ||
| return this; | ||
| } |
Comment on lines
+76
to
+96
| /** | ||
| * Sets a specific detail in the details map with the provided key and value. This can be used to add additional context about the account error, such as which field was invalid or what the expected format was. | ||
| * | ||
| * @param key The key for the detail. | ||
| * @param value The value for the detail. | ||
| */ | ||
| public void set(String key, Object value) { | ||
| details.put(key, value); | ||
| } | ||
|
|
||
| /** | ||
| * Sets a specific detail in the details map with the provided key and value, and returns the AccountException instance for method chaining. This can be used to add additional context about the account error while allowing for fluent API style when constructing the exception. | ||
| * | ||
| * @param key The key for the detail. | ||
| * @param value The value for the detail. | ||
| * @return The AccountException instance, allowing for method chaining. | ||
| */ | ||
| public AccountException with(String key, Object value) { | ||
| details.put(key, value); | ||
| return this; | ||
| } |
Comment on lines
+18
to
+20
| public void add(E value, K priority) { | ||
| queue.add(new Pair<>(priority, value)); | ||
| } |
Comment on lines
+143
to
+147
| if (value instanceof ULID target) { | ||
| return target.toString(); | ||
| } | ||
|
|
||
| return value.toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.