src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/SessionProperty.java
branchJDK-8188051-branch
changeset 56828 64304e37e9b1
parent 56824 62e92191354d
child 56832 4f7713e6a308
equal deleted inserted replaced
56827:1a36ad36c9e9 56828:64304e37e9b1
    79    * @return true iff this is sensitive
    79    * @return true iff this is sensitive
    80    */
    80    */
    81   public boolean isSensitive();
    81   public boolean isSensitive();
    82 
    82 
    83   /**
    83   /**
    84    * Returns an {@link Operation} that will configure the {@link Session} to have the
    84    * Creates and submits zero or more {@link Operation}s that will configure the
    85    * specified property value.May return {@code null} if no {@link Operation} needed. The
    85    * {@link Session} to have the specified property value. Returns {@code true}
    86  returned {@link Operation} is a member of group but is not submitted.
    86    * if any {@link Operation}s were submitted. {@code false} otherwise.
    87    *
    87    *
    88    * Called by {@link Session.Builder#build()} to configure a {@link Session} as specified
    88    * Called by {@link Session.Builder#build()} to configure a {@link Session} as
    89    * in the {@link Session.Builder#property} method. SessionProperties known to the implementation
    89    * specified in the {@link Session.Builder#property} method. SessionProperties
    90    * may return {@code null} and rely on the implementation to do the right thing.
    90    * known to the implementation may return {@code false} and rely on the
       
    91    * implementation to do the right thing.
    91    *
    92    *
    92    * @param <S>
    93    * @param group an {@link OperationGroup} which will be the container of the
    93    * @param group an {@link OperationGroup} which will be the container of the returned
    94    * submitted {@link Operation}s, if any
    94    * {@link Operation}, if any
       
    95    * @param value the value to which the property is to be set. May be null if
    95    * @param value the value to which the property is to be set. May be null if
    96    * {@link range()} is {@link Void}.
    96    * {@link range()} is {@link Void}.
    97    * @return an {@link Operation} or null
    97    * @return true if any {@link Operation}s were submitted, false otherwise
    98    * @throws IllegalStateException if it is not possible to configure the
    98    * @throws IllegalStateException if it is not possible to configure the
    99    * {@link Session} as specified.
    99    * {@link Session} as specified.
   100    * @throws IllegalArgumentException if {@code this.validate(value)} returns {@code false}
   100    * @throws IllegalArgumentException if {@code this.validate(value)} returns
       
   101    * {@code false}
   101    */
   102    */
   102   public default <S> Operation<? extends S> configureOperation(OperationGroup<S, ?> group, Object value) {
   103   public default boolean configureOperation(OperationGroup<?, ?> group, Object value) {
   103     if (validate(value)) {
   104     if (validate(value)) {
   104       return null;
   105       return false;
   105     }
   106     }
   106     else {
   107     else {
   107       throw new IllegalArgumentException(value.toString() + " is invalid");
   108       throw new IllegalArgumentException(value.toString() + " is invalid");
   108     }
   109     }
   109   }
   110   }