public final class Key extends IncompleteKey
Entity.
This class is immutable.| Modifier and Type | Class and Description |
|---|---|
static class |
Key.Builder |
| Modifier and Type | Method and Description |
|---|---|
static Key.Builder |
builder(IncompleteKey copyFrom,
long id)
Deprecated.
|
static Key.Builder |
builder(IncompleteKey copyFrom,
String name)
Deprecated.
|
static Key.Builder |
builder(Key copyFrom)
Deprecated.
|
static Key.Builder |
builder(Key parent,
String kind,
long id)
Deprecated.
|
static Key.Builder |
builder(Key parent,
String kind,
String name)
Deprecated.
|
static Key.Builder |
builder(String projectId,
String kind,
long id)
Deprecated.
|
static Key.Builder |
builder(String projectId,
String kind,
String name)
Deprecated.
|
static Key |
fromUrlSafe(String urlSafe)
Create a
Key given its URL safe encoded form. |
Long |
getId()
Returns the key's id or
null if it has a name instead. |
String |
getName()
Returns the key's name or
null if it has an id instead. |
Object |
getNameOrId()
|
boolean |
hasId() |
boolean |
hasName() |
Long |
id()
Deprecated.
|
String |
name()
Deprecated.
|
Object |
nameOrId()
Deprecated.
|
static Key.Builder |
newBuilder(IncompleteKey copyFrom,
long id) |
static Key.Builder |
newBuilder(IncompleteKey copyFrom,
String name) |
static Key.Builder |
newBuilder(Key copyFrom) |
static Key.Builder |
newBuilder(Key parent,
String kind,
long id) |
static Key.Builder |
newBuilder(Key parent,
String kind,
String name) |
static Key.Builder |
newBuilder(String projectId,
String kind,
long id) |
static Key.Builder |
newBuilder(String projectId,
String kind,
String name) |
String |
toUrlSafe()
Returns the key in an encoded form that can be used as part of a URL.
|
builder, builder, builder, getParent, newBuilder, newBuilder, newBuilder, parentancestors, equals, getAncestors, getKind, getNamespace, getProjectId, hashCode, kind, namespace, projectId, toStringpublic boolean hasId()
@Deprecated public Long id()
null if it has a name instead.public Long getId()
null if it has a name instead.public boolean hasName()
@Deprecated public String name()
null if it has an id instead.public String getName()
null if it has an id instead.@Deprecated public Object nameOrId()
public Object getNameOrId()
public String toUrlSafe()
public static Key fromUrlSafe(String urlSafe)
Key given its URL safe encoded form.IllegalArgumentException - when decoding fails@Deprecated public static Key.Builder builder(String projectId, String kind, String name)
public static Key.Builder newBuilder(String projectId, String kind, String name)
@Deprecated public static Key.Builder builder(String projectId, String kind, long id)
public static Key.Builder newBuilder(String projectId, String kind, long id)
@Deprecated public static Key.Builder builder(Key copyFrom)
public static Key.Builder newBuilder(Key copyFrom)
@Deprecated public static Key.Builder builder(IncompleteKey copyFrom, String name)
public static Key.Builder newBuilder(IncompleteKey copyFrom, String name)
@Deprecated public static Key.Builder builder(IncompleteKey copyFrom, long id)
public static Key.Builder newBuilder(IncompleteKey copyFrom, long id)
@Deprecated public static Key.Builder builder(Key parent, String kind, String name)
public static Key.Builder newBuilder(Key parent, String kind, String name)
@Deprecated public static Key.Builder builder(Key parent, String kind, long id)
public static Key.Builder newBuilder(Key parent, String kind, long id)
Copyright © 2017 Google. All rights reserved.