Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  * either express or implied. See the License for the specific language
  * governing permissions and limitations under the License.
  */
 package org.dbflute.dbmeta.accessory;
 
 import java.util.Set;
 
The modified properties of entity. (basically for Framework)

Author(s):
jflute
Since:
1.1.0 (2014/10/29 Monday)
 
 public class EntityModifiedProperties implements Serializable {
 
     // ===================================================================================
     //                                                                          Definition
     //                                                                          ==========
     
The serial version UID for object serialization. (Default)
 
     private static final long serialVersionUID = 1L;
 
     // ===================================================================================
     //                                                                           Attribute
     //                                                                           =========
     
The set of property names. (NullAllowed: lazy-loaded)
 
     protected Set<String_propertyNameSet;
 
     // ===================================================================================
     //                                                                   Property Handling
     //                                                                   =================
     
Add property name. (according to Java Beans rule)

Parameters:
propertyName The string for name. (NotNull)
 
     public void addPropertyName(String propertyName) {
         assertPropertyNameNotNull(propertyName);
         getPropertyNameSet().add(propertyName);
     }
 
     protected void assertPropertyNameNotNull(String propertyName) {
         if (propertyName == null) {
             throw new IllegalArgumentException("The argument 'propertyName' should not be null.");
         }
     }

    
Get the set of properties.

Returns:
The set of properties, read-only. (NotNull)
 
     public Set<StringgetPropertyNames() {
         if ( != null) {
             return Collections.unmodifiableSet();
         }
         return DfCollectionUtil.emptySet();
     }

    
Is the property modified?

Parameters:
propertyName The name of property. (NotNull)
Returns:
The determination, true or false.
 
     public boolean isModifiedProperty(String propertyName) {
         return  != null && .contains(propertyName);
     }

    
Is the set of properties empty?

Returns:
The determination, true or false.
 
     public boolean isEmpty() {
         return  == null || getPropertyNameSet().isEmpty();
     }

    
Clear the set of properties.
 
     public void clear() {
         if ( != null) {
             getPropertyNameSet().clear();
         }
     }

    
Remove property name from the set. (according to Java Beans rule)

Parameters:
propertyName The string for name. (NotNull)
    public void remove(String propertyName) {
        assertPropertyNameNotNull(propertyName);
        if ( != null) {
            getPropertyNameSet().remove(propertyName);
        }
    }

    
Accept specified properties. (after clearing this properties)

Parameters:
properties The properties as copy-resource. (NotNull)
    public void accept(EntityModifiedProperties properties) {
        if (properties == null) {
            throw new IllegalArgumentException("The argument 'properties' should not be null.");
        }
        clear();
        for (String propertyName : properties.getPropertyNames()) {
            addPropertyName(propertyName);
        }
    }
    protected Set<StringgetPropertyNameSet() {
        if ( == null) {
             = new LinkedHashSet<String>();
        }
        return ;
    }
    // ===================================================================================
    //                                                                      Basic Override
    //                                                                      ==============
    @Override
    public String toString() {
        return "modifiedProp:" + ;
    }
New to GrepCode? Check out our FAQ X