01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.layout.node;
07:
08: import org.jasig.portal.core.ObjectIdFactory;
09:
10: /**
11: * The object Ids factory.
12: * @author Michael Ivanov, mvi@immagic.com
13: * @version $Revision: 35173 $
14: */
15: public abstract class NodeIdFactory extends ObjectIdFactory {
16:
17: protected static class NodeIdImpl extends ObjectIdImpl implements
18: INodeId {
19:
20: public NodeIdImpl(String id) {
21: super (id);
22: }
23:
24: public NodeIdImpl(int id) {
25: super (id);
26: }
27:
28: public NodeIdImpl(long id) {
29: super (id);
30: }
31:
32: public boolean equals(Object obj) {
33: return ((obj instanceof INodeId) && id.equals(obj
34: .toString()));
35: }
36: }
37:
38: public static INodeId createNodeId(String id) {
39: return new NodeIdImpl(id);
40: }
41:
42: public static INodeId createNodeId(int id) {
43: return new NodeIdImpl(id);
44: }
45:
46: public static INodeId createNodeId(long id) {
47: return new NodeIdImpl(id);
48: }
49: }
|