From 7c6eb95a14d5467c8396524645a1b2d9273a7300 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Mon, 23 Oct 2006 18:14:09 +0000 Subject: Examples make consistent use of get/set pair. --- src/main/java/com/amazon/carbonado/Alias.java | 1 + src/main/java/com/amazon/carbonado/AlternateKeys.java | 4 ++++ src/main/java/com/amazon/carbonado/Independent.java | 1 + src/main/java/com/amazon/carbonado/Indexes.java | 4 ++++ src/main/java/com/amazon/carbonado/Join.java | 6 ++++-- src/main/java/com/amazon/carbonado/Nullable.java | 1 + src/main/java/com/amazon/carbonado/PrimaryKey.java | 1 + src/main/java/com/amazon/carbonado/Sequence.java | 1 + src/main/java/com/amazon/carbonado/Version.java | 1 + src/main/java/com/amazon/carbonado/adapter/AdapterDefinition.java | 1 + src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java | 1 + src/main/java/com/amazon/carbonado/adapter/TextAdapter.java | 1 + src/main/java/com/amazon/carbonado/adapter/TrueFalseAdapter.java | 1 - src/main/java/com/amazon/carbonado/adapter/YesNoAdapter.java | 1 - .../java/com/amazon/carbonado/constraint/ConstraintDefinition.java | 1 + src/main/java/com/amazon/carbonado/constraint/FloatConstraint.java | 1 - .../java/com/amazon/carbonado/constraint/IntegerConstraint.java | 2 -- src/main/java/com/amazon/carbonado/constraint/LengthConstraint.java | 3 +-- src/main/java/com/amazon/carbonado/constraint/TextConstraint.java | 1 - 19 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/main/java/com/amazon/carbonado/Alias.java b/src/main/java/com/amazon/carbonado/Alias.java index b2e122c..76caade 100644 --- a/src/main/java/com/amazon/carbonado/Alias.java +++ b/src/main/java/com/amazon/carbonado/Alias.java @@ -35,6 +35,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable<UserInfo> { * @Alias("USER_ID") * long getUserInfoID(); + * void setUserInfoID(long id); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/AlternateKeys.java b/src/main/java/com/amazon/carbonado/AlternateKeys.java index 9d27f12..ef73088 100644 --- a/src/main/java/com/amazon/carbonado/AlternateKeys.java +++ b/src/main/java/com/amazon/carbonado/AlternateKeys.java @@ -31,12 +31,16 @@ import java.lang.annotation.*; * @PrimaryKey("ID") * public interface FileInfo extends Storable<FileInfo> { * long getID(); + * void setID(long id); * * String getFullPath(); + * void setFullPath(String path); * * String getName(); + * void setName(String name); * * long getParentID(); + * void setParentID(long id); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/Independent.java b/src/main/java/com/amazon/carbonado/Independent.java index f240fe5..ab4b50b 100644 --- a/src/main/java/com/amazon/carbonado/Independent.java +++ b/src/main/java/com/amazon/carbonado/Independent.java @@ -45,6 +45,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable<UserInfo> { * @Independent * String getName(); + * void setName(String name); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/Indexes.java b/src/main/java/com/amazon/carbonado/Indexes.java index 482f955..ad14f5d 100644 --- a/src/main/java/com/amazon/carbonado/Indexes.java +++ b/src/main/java/com/amazon/carbonado/Indexes.java @@ -33,12 +33,16 @@ import java.lang.annotation.*; * @PrimaryKey("ID") * public interface FileInfo extends Storable<FileInfo> { * long getID(); + * void setID(long id); * * String getName(); + * void setName(String name); * * long getLength(); + * void setLength(long length); * * long getLastModified(); + * void getLastModified(long datetime); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/Join.java b/src/main/java/com/amazon/carbonado/Join.java index eb21e58..d388769 100644 --- a/src/main/java/com/amazon/carbonado/Join.java +++ b/src/main/java/com/amazon/carbonado/Join.java @@ -66,29 +66,31 @@ import java.lang.annotation.*; * @PrimaryKey("userID") * public interface UserInfo extends Storable { * int getUserID(); + * void setUserID(int id); * * int getAddressID(); - * * void setAddressID(int value); * * // Natural join, which works because Address has a primary key * // property of addressID which matches a property in this type. * @Join * Address getAddress() throws FetchException; + * void setAddress(Address address); * * // Explicit join, equivalent to getAddress. * @Join(internal="addressID", external="addressID") * Address getCurrentAddress() throws FetchException; + * void setCurrentAddress(Address address); * * @Nullable * Integer getParentID(); - * * void setParentID(Integer value); * * // Many-to-one relationship * @Nullable * @Join(internal="parentID", external="userID") * UserInfo getParent() throws FetchException; + * void setParent(UserInfo parent); * * // One-to-many relationship * @Join(internal="userID", external="parentID") diff --git a/src/main/java/com/amazon/carbonado/Nullable.java b/src/main/java/com/amazon/carbonado/Nullable.java index c8ac923..4ce63ec 100644 --- a/src/main/java/com/amazon/carbonado/Nullable.java +++ b/src/main/java/com/amazon/carbonado/Nullable.java @@ -30,6 +30,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable<UserInfo> { * @Nullable * String getName(); + * void setName(String name); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/PrimaryKey.java b/src/main/java/com/amazon/carbonado/PrimaryKey.java index ffea9be..8473938 100644 --- a/src/main/java/com/amazon/carbonado/PrimaryKey.java +++ b/src/main/java/com/amazon/carbonado/PrimaryKey.java @@ -29,6 +29,7 @@ import java.lang.annotation.*; * @PrimaryKey("userInfoID") * public interface UserInfo extends Storable<UserInfo> { * long getUserInfoID(); + * void setUserInfoID(long id); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/Sequence.java b/src/main/java/com/amazon/carbonado/Sequence.java index ea38493..a810e39 100644 --- a/src/main/java/com/amazon/carbonado/Sequence.java +++ b/src/main/java/com/amazon/carbonado/Sequence.java @@ -31,6 +31,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable<UserInfo> { * @Sequence("USER_ID_SEQ") * long getUserInfoID(); + * void setUserInfoID(long id); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/Version.java b/src/main/java/com/amazon/carbonado/Version.java index 9bb326a..7c3c2b4 100644 --- a/src/main/java/com/amazon/carbonado/Version.java +++ b/src/main/java/com/amazon/carbonado/Version.java @@ -62,6 +62,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable { * @Version * int getRecordVersionNumber(); + * void setRecordVersionNumber(int version); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/adapter/AdapterDefinition.java b/src/main/java/com/amazon/carbonado/adapter/AdapterDefinition.java index 0787010..f6292b9 100644 --- a/src/main/java/com/amazon/carbonado/adapter/AdapterDefinition.java +++ b/src/main/java/com/amazon/carbonado/adapter/AdapterDefinition.java @@ -87,6 +87,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable { * @TrueFalseAdapter * boolean isAdministrator(); + * void setAdministrator(boolean admin); * } * * diff --git a/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java b/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java index 5102b70..af715ac 100644 --- a/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java +++ b/src/main/java/com/amazon/carbonado/adapter/DateTimeAdapter.java @@ -48,6 +48,7 @@ import com.amazon.carbonado.adapter.AdapterDefinition; * public interface UserInfo extends Storable { * @DateTimeAdapter(timeZone="UTC") * DateTime getModifyDateTime(); + * void setModifyDateTime(DateTime dt); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java b/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java index e07ed50..8a51c3f 100644 --- a/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java +++ b/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java @@ -52,6 +52,7 @@ import com.amazon.carbonado.adapter.AdapterDefinition; * public interface UserInfo extends Storable { * @TextAdapter(charset="UTF-8") * String getWelcomeMessage(); + * void setWelcomeMessage(String message); * * ... * } diff --git a/src/main/java/com/amazon/carbonado/adapter/TrueFalseAdapter.java b/src/main/java/com/amazon/carbonado/adapter/TrueFalseAdapter.java index 886b994..74dcd09 100644 --- a/src/main/java/com/amazon/carbonado/adapter/TrueFalseAdapter.java +++ b/src/main/java/com/amazon/carbonado/adapter/TrueFalseAdapter.java @@ -31,7 +31,6 @@ import java.lang.annotation.Target; * public interface UserInfo extends Storable { * @TrueFalseAdapter * boolean isAdministrator(); - * * void setAdministrator(boolean admin); * * ... diff --git a/src/main/java/com/amazon/carbonado/adapter/YesNoAdapter.java b/src/main/java/com/amazon/carbonado/adapter/YesNoAdapter.java index 4d9c979..f28b4af 100644 --- a/src/main/java/com/amazon/carbonado/adapter/YesNoAdapter.java +++ b/src/main/java/com/amazon/carbonado/adapter/YesNoAdapter.java @@ -31,7 +31,6 @@ import java.lang.annotation.Target; * public interface UserInfo extends Storable { * @YesNoAdapter * boolean isAdministrator(); - * * void setAdministrator(boolean admin); * * ... diff --git a/src/main/java/com/amazon/carbonado/constraint/ConstraintDefinition.java b/src/main/java/com/amazon/carbonado/constraint/ConstraintDefinition.java index 22514fc..73db4ef 100644 --- a/src/main/java/com/amazon/carbonado/constraint/ConstraintDefinition.java +++ b/src/main/java/com/amazon/carbonado/constraint/ConstraintDefinition.java @@ -83,6 +83,7 @@ import java.lang.annotation.*; * public interface UserInfo extends Storable { * ... * + * int getAge(); * // Constraint is called before setting age. * @IntegerConstraint(min=0, max=120) * void setAge(int value); diff --git a/src/main/java/com/amazon/carbonado/constraint/FloatConstraint.java b/src/main/java/com/amazon/carbonado/constraint/FloatConstraint.java index 31b6503..29c5c83 100644 --- a/src/main/java/com/amazon/carbonado/constraint/FloatConstraint.java +++ b/src/main/java/com/amazon/carbonado/constraint/FloatConstraint.java @@ -32,7 +32,6 @@ import com.amazon.carbonado.MalformedTypeException; *

Example:

  * public interface PolarCoordinate extends Storable {
  *     double getTheta();
- *
  *     @FloatConstraint(min=0, max=Math.PI * 2, disallowed=Double.NaN)
  *     void setTheta(double radians);
  *
diff --git a/src/main/java/com/amazon/carbonado/constraint/IntegerConstraint.java b/src/main/java/com/amazon/carbonado/constraint/IntegerConstraint.java
index 69fa5cc..56171fd 100644
--- a/src/main/java/com/amazon/carbonado/constraint/IntegerConstraint.java
+++ b/src/main/java/com/amazon/carbonado/constraint/IntegerConstraint.java
@@ -32,12 +32,10 @@ import com.amazon.carbonado.MalformedTypeException;
  * 

Example:

  * public interface UserInfo extends Storable {
  *     int getAge();
- *
  *     @IntegerConstraint(min=0, max=120)
  *     void setAge(int value);
  *
  *     int getRoleID();
- *
  *     @IntegerConstraint(allowed={ROLE_REGULAR, ROLE_ADMIN})
  *     void setRoleID(int role);
  *
diff --git a/src/main/java/com/amazon/carbonado/constraint/LengthConstraint.java b/src/main/java/com/amazon/carbonado/constraint/LengthConstraint.java
index 7e17a1f..1ffb4b5 100644
--- a/src/main/java/com/amazon/carbonado/constraint/LengthConstraint.java
+++ b/src/main/java/com/amazon/carbonado/constraint/LengthConstraint.java
@@ -30,8 +30,7 @@ import com.amazon.carbonado.MalformedTypeException;
  *
  * 

Example:

  * public interface UserInfo extends Storable {
- *     int getFirstName();
- *
+ *     String getFirstName();
  *     @LengthConstraint(min=1, max=50)
  *     void setFirstName(String name);
  *
diff --git a/src/main/java/com/amazon/carbonado/constraint/TextConstraint.java b/src/main/java/com/amazon/carbonado/constraint/TextConstraint.java
index 08574e8..a9e90db 100644
--- a/src/main/java/com/amazon/carbonado/constraint/TextConstraint.java
+++ b/src/main/java/com/amazon/carbonado/constraint/TextConstraint.java
@@ -32,7 +32,6 @@ import com.amazon.carbonado.MalformedTypeException;
  * 

Example:

  * public interface UserInfo extends Storable {
  *     char isActive();
- *
  *     @TextConstraint(allowed={"Y", "N"})
  *     void setActive(char value);
  *
-- 
cgit v1.2.3