Skip to main content
summaryrefslogtreecommitdiffstats
blob: a475ca548f3d538e4334dd798a4b2687dd27cf7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*********************************************************************
 * Copyright (c) 2016 Boeing
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     Boeing - initial API and implementation
 **********************************************************************/

package org.eclipse.osee.framework.core.data;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.eclipse.osee.framework.jdk.core.type.BaseId;
import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.IdSerializer;

/**
 * @author Ryan D. Brooks
 */
@JsonSerialize(using = IdSerializer.class)
public interface RelationId extends Id {
   RelationId SENTINEL = valueOf(Id.SENTINEL);

   public static RelationId valueOf(String id) {
      return Id.valueOf(id, RelationId::valueOf);
   }

   public static RelationId valueOf(long id) {
      return valueOf(Long.valueOf(id));
   }

   public static RelationId valueOf(Long id) {
      final class RelationIdImpl extends BaseId implements RelationId {
         public RelationIdImpl(Long txId) {
            super(txId);
         }
      }
      return new RelationIdImpl(id);
   }
}

Back to the top