Committed by
Gerrit Code Review
Revise Javadoc
- Remove the word "path" as no ResourcePath anymore - Write conditions that a method throws an exception Change-Id: Ie2f2e1cfd1c6c68051e6700ef4308363a71d9453
Showing
2 changed files
with
18 additions
and
14 deletions
| ... | @@ -42,9 +42,9 @@ public interface Resource { | ... | @@ -42,9 +42,9 @@ public interface Resource { |
| 42 | DiscreteResource ROOT = new DiscreteResource(); | 42 | DiscreteResource ROOT = new DiscreteResource(); |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | - * Returns the components of this resource path. | 45 | + * Returns the components of this resource. |
| 46 | * | 46 | * |
| 47 | - * @return the components of this resource path | 47 | + * @return the components of this resource |
| 48 | */ | 48 | */ |
| 49 | List<Object> components(); | 49 | List<Object> components(); |
| 50 | 50 | ||
| ... | @@ -58,30 +58,34 @@ public interface Resource { | ... | @@ -58,30 +58,34 @@ public interface Resource { |
| 58 | <T> T volume(); | 58 | <T> T volume(); |
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | - * Returns the parent resource path of this instance. | 61 | + * Returns the parent resource of this instance. |
| 62 | - * E.g. if this path is Link:1/VLAN ID:100, the return value is the resource path for Link:1. | 62 | + * E.g. if this resource is Link:1/VLAN ID:100, the return value is the resource for Link:1. |
| 63 | * | 63 | * |
| 64 | - * @return the parent resource path of this instance. | 64 | + * @return the parent resource of this instance. |
| 65 | * If there is no parent, empty instance will be returned. | 65 | * If there is no parent, empty instance will be returned. |
| 66 | */ | 66 | */ |
| 67 | Optional<DiscreteResource> parent(); | 67 | Optional<DiscreteResource> parent(); |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | - * Returns a child resource path of this instance with specifying the child object. | 70 | + * Returns a child resource of this instance with specifying the child object. |
| 71 | - * The child resource path is discrete-type. | 71 | + * It is not allowed that a continuous type resource has a child. If the instance is |
| 72 | + * ContinuousResource, {@link UnsupportedOperationException} is thrown. If the given | ||
| 73 | + * object is a {@link Class} instance, {@link IllegalArgumentException} is thrown. | ||
| 72 | * | 74 | * |
| 73 | * @param child child object | 75 | * @param child child object |
| 74 | - * @return a child resource path | 76 | + * @return a child resource |
| 77 | + * @throws IllegalArgumentException if the given object is a {@link Class} instance. | ||
| 75 | */ | 78 | */ |
| 76 | DiscreteResource child(Object child); | 79 | DiscreteResource child(Object child); |
| 77 | 80 | ||
| 78 | /** | 81 | /** |
| 79 | - * Returns a child resource path of this instance with specifying a child object and | 82 | + * Returns a child resource of this instance with specifying a child object and |
| 80 | - * value. The child resource path is continuous-type. | 83 | + * value. It is not allowed that a continuous type resource has a child. If the instance is |
| 84 | + * ContinuousResource, {@link UnsupportedOperationException} is thrown. | ||
| 81 | * | 85 | * |
| 82 | * @param child child object | 86 | * @param child child object |
| 83 | * @param value value | 87 | * @param value value |
| 84 | - * @return a child resource path | 88 | + * @return a child resource |
| 85 | */ | 89 | */ |
| 86 | ContinuousResource child(Class<?> child, double value); | 90 | ContinuousResource child(Class<?> child, double value); |
| 87 | 91 | ||
| ... | @@ -94,9 +98,9 @@ public interface Resource { | ... | @@ -94,9 +98,9 @@ public interface Resource { |
| 94 | Object last(); | 98 | Object last(); |
| 95 | 99 | ||
| 96 | /** | 100 | /** |
| 97 | - * Returns the ID of this resource path. | 101 | + * Returns the ID of this resource. |
| 98 | * | 102 | * |
| 99 | - * @return the ID of this resource path | 103 | + * @return the ID of this resource |
| 100 | */ | 104 | */ |
| 101 | ResourceId id(); | 105 | ResourceId id(); |
| 102 | } | 106 | } | ... | ... |
| ... | @@ -30,7 +30,7 @@ public abstract class ResourceId { | ... | @@ -30,7 +30,7 @@ public abstract class ResourceId { |
| 30 | /** | 30 | /** |
| 31 | * Returns the parent resource ID of this instance. | 31 | * Returns the parent resource ID of this instance. |
| 32 | * | 32 | * |
| 33 | - * @return the parent resource path of this instance. | 33 | + * @return the parent resource ID of this instance. |
| 34 | * If there is no parent, empty instance will be returned. | 34 | * If there is no parent, empty instance will be returned. |
| 35 | */ | 35 | */ |
| 36 | public abstract Optional<DiscreteResourceId> parent(); | 36 | public abstract Optional<DiscreteResourceId> parent(); | ... | ... |
-
Please register or login to post a comment