Send feedback
Class Key (2.11.4)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.11.4 keyboard_arrow_down
public final class Key extends IncompleteKey
Static Methods
fromUrlSafe(String urlSafe)
public static Key fromUrlSafe ( String urlSafe )
Create a Key
given its URL safe encoded form.
Parameter
Returns
newBuilder(IncompleteKey copyFrom, String name)
public static Key . Builder newBuilder ( IncompleteKey copyFrom , String name )
Parameters
Returns
newBuilder(IncompleteKey copyFrom, long id)
public static Key . Builder newBuilder ( IncompleteKey copyFrom , long id )
Parameters
Returns
newBuilder(Key copyFrom)
public static Key . Builder newBuilder ( Key copyFrom )
Parameter
Name Description copyFrom Key
Returns
newBuilder(Key parent, String kind, String name)
public static Key . Builder newBuilder ( Key parent , String kind , String name )
Parameters
Returns
newBuilder(Key parent, String kind, long id)
public static Key . Builder newBuilder ( Key parent , String kind , long id )
Parameters
Returns
newBuilder(String projectId, String kind, String name)
public static Key . Builder newBuilder ( String projectId , String kind , String name )
Parameters
Returns
newBuilder(String projectId, String kind, long id)
public static Key . Builder newBuilder ( String projectId , String kind , long id )
Parameters
Returns
Methods
getId()
Returns the key's id or null
if it has a name instead.
Returns
getName()
Returns the key's name or null
if it has an id instead.
Returns
getNameOrId()
public Object getNameOrId ()
Returns the key's ID (as Long ) or name (as String ). Never null
.
Returns
hasId()
Returns
hasName()
Returns
toUrlSafe()
public String toUrlSafe ()
Returns the key in an encoded form that can be used as part of a URL.
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-05 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-05 UTC."],[],[]]