FileDocCategorySizeDatePackage
VersionedSample.javaAPI DocExample1695Mon Nov 24 10:06:42 GMT 2003com.oreilly.patterns.chapter10

VersionedSample

public class VersionedSample extends Object implements Versioned

Fields Summary
private String
name
private String
address
private String
city
private long
pkey
private long
version
Constructors Summary
public VersionedSample(long primaryKey)

   
       
        pkey = primaryKey;
    
Methods Summary
public booleanequalsVersion(java.lang.Object o)

        if (this == o) return true;
        if (!(o instanceof VersionedSample)) return false;

        final VersionedSample versionedSample = (VersionedSample) o;
        if(versionedSample.pkey != this.pkey) return false;

        if (version != versionedSample.version) return false;
        if (address != null ? !address.equals(versionedSample.address) :   
            versionedSample.address != null) return false;
        if (city != null ? !city.equals(versionedSample.city) : 
            versionedSample.city != null) return false;
        if (name != null ? !name.equals(versionedSample.name) :
            versionedSample.name != null) return false;

        return true;
    
public java.lang.StringgetAddress()

        return address;
    
public java.lang.StringgetCity()

        return city;
    
public java.lang.StringgetName()

        return name;
    
public longgetVersion()

        return version;
    
public voidsetAddress(java.lang.String address)

        this.address = address;
        version++;
    
public voidsetCity(java.lang.String city)

        this.city = city;
        version++;
    
public voidsetName(java.lang.String name)

        this.name = name;
        version++;