1 package org.jboss.cache.pojo.test.propagation.impl; 2 3 import org.jboss.cache.pojo.test.propagation.PropagationRule; 4 import org.jboss.cache.pojo.test.propagation.StateItem; 5 6 public class StateItemImpl implements StateItem 7 { 8 private long itemId_; 9 private long state_; 10 11 public StateItemImpl() 12 { 13 } 14 15 public StateItemImpl(long itemId) 16 { 17 this.itemId_ = itemId; 18 this.state_ = PropagationRule.STATE_CLEAR; 19 } 20 21 public long getState() 22 { 23 return this.state_; 24 } 25 26 public boolean setState(long state) 27 { 28 if (this.state_ != state) 29 { 30 state_ = state; 31 return STATE_CHANGED; 32 } else 33 { 34 return STATE_NOT_CHANGED; 35 } 36 } 37 38 public long getItemId() 39 { 40 return this.itemId_; 41 } 42 43 public String toString() 44 { 45 return "Id: " + itemId_ + " state: " + state_ + "\n"; 46 } 47 } 48 | Popular Tags |