HelloWorld.java
[Java Example]

[$(NDDSHOME)/example/JAVA/helloWorldPersistence/HelloWorld.java]
/*
  WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.

  This file was generated from .idl using "rtiddsgen".
  The rtiddsgen tool is part of the RTI Data Distribution Service distribution.
  For more information, type 'rtiddsgen -help' at a command shell
  or consult the RTI Data Distribution Service manual.
*/
    

import com.rti.dds.infrastructure.*;
import com.rti.dds.infrastructure.Copyable;

import java.io.Serializable;
import com.rti.dds.cdr.CdrHelper;


public class HelloWorld implements Copyable, Serializable
{

    public int data;


    public HelloWorld() {

    }


    public HelloWorld(HelloWorld other) {

        this();
        copy_from(other);
    }



    public static Object create() {
        return new HelloWorld();
    }

    public boolean equals(Object o) {
                
        if (o == null) {
            return false;
        }        
        
        

        if(getClass() != o.getClass()) {
            return false;
        }

        HelloWorld otherObj = (HelloWorld)o;



        if(data != otherObj.data) {
            return false;
        }
            
        return true;
    }

    public int hashCode() {
        int __result = 0;

        __result += (int)data;
                
        return __result;
    }
    

    public Object copy_from(Object src) {
        

        HelloWorld typedSrc = (HelloWorld) src;
        HelloWorld typedDst = this;

        typedDst.data = typedSrc.data;
            
        return this;
    }


    
    public String toString(){
        return toString("", 0);
    }
        
    
    public String toString(String desc, int indent) {
        StringBuffer strBuffer = new StringBuffer();        
                        
        
        if (desc != null) {
            CdrHelper.printIndent(strBuffer, indent);
            strBuffer.append(desc).append(":\n");
        }
        
        
        CdrHelper.printIndent(strBuffer, indent+1);            
        strBuffer.append("data: ").append(data).append("\n");
            
        return strBuffer.toString();
    }
    
}


RTI Persistence Service Version 4.5e Copyright © 23 Oct 2011 Real-Time Innovations, Inc