-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve how arguments are handled internally
- Loading branch information
1 parent
5059415
commit 9365f61
Showing
8 changed files
with
65 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
39 changes: 39 additions & 0 deletions
39
...e4j/aspire4j/src/main/java/com/microsoft/aspire/resources/annotations/ArgsAnnotation.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.microsoft.aspire.resources.annotations; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class ArgsAnnotation implements ResourceAnnotation { | ||
private final String type; | ||
private final List<Object> args; | ||
|
||
public static ArgsAnnotation createArgs(Object value) { | ||
return createArgs(List.of(value)); | ||
} | ||
|
||
public static ArgsAnnotation createArgs(List<Object> values) { | ||
return new ArgsAnnotation("args", values); | ||
} | ||
|
||
private ArgsAnnotation(String type, List<Object> values) { | ||
this.type = Objects.requireNonNull(type, "Type cannot be null"); | ||
Objects.requireNonNull(values, "Value cannot be null"); | ||
this.args = values; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public List<Object> getArgs() { | ||
return args; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ArgsAnnotation{" + | ||
"type='" + type + '\'' + | ||
", args='" + args.toString() + '\'' + | ||
'}'; | ||
} | ||
} |
17 changes: 6 additions & 11 deletions
17
...j/aspire4j/src/main/java/com/microsoft/aspire/resources/traits/ResourceWithArguments.java
This file contains 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
This file contains 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