Skip to content

Commit

Permalink
touchup of deprecation annotation and Entity convenience constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Kruth committed Jun 11, 2024
1 parent 8e8d6a6 commit f57bd21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ abstract class DefaultRepository<
* {link {@link #saveStatus(com.expediagroup.streamplatform.streamregistry.model.Entity)}}
* to save the entity specification or entity status independently.
*/
@Deprecated
@Override
public ME save(ME entity) {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018-2021 Expedia, Inc.
* Copyright (C) 2018-2024 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,7 @@
*/
package com.expediagroup.streamplatform.streamregistry.state.model;

import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.Value;
import lombok.With;
Expand All @@ -24,16 +25,24 @@
import com.expediagroup.streamplatform.streamregistry.state.model.specification.ProcessSpecification;
import com.expediagroup.streamplatform.streamregistry.state.model.specification.Specification;
import com.expediagroup.streamplatform.streamregistry.state.model.specification.StreamSpecification;
import com.expediagroup.streamplatform.streamregistry.state.model.status.DefaultStatus;
import com.expediagroup.streamplatform.streamregistry.state.model.status.Status;

@Value
@AllArgsConstructor
public class Entity<K extends Entity.Key<S>, S extends Specification> {
@NonNull K key;
@With
@NonNull S specification;
@With
@NonNull Status status;

public Entity(K key, S specification) {
this.key = key;
this.specification = specification;
this.status = new DefaultStatus();
}

public interface Key<S extends Specification> {}

@Value
Expand Down

0 comments on commit f57bd21

Please sign in to comment.