Send feedback
  
   
 
  
    
      Class Entity (2.32.2) 
  
  
  
   
  
    
  
  
    
    
    
    
    
  Version latestkeyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   final   class  Entity   extends   FullEntity<Key>  
  An entity is the Google Cloud Datastore persistent data object for a specific key. An entity will
 always have a complete Key .
Static Methods
   
  calculateSerializedSize(BaseEntity<? extends IncompleteKey> entity) 
  
    
public   static   int   calculateSerializedSize ( BaseEntity <?   extends   IncompleteKey >  entity )  
  Returns the size in bytes of the protobuf form of the provided entity.
    
      
        Parameter  
      
        Name Description  
      
        entityBaseEntity <? extends com.google.cloud.datastore.IncompleteKey >object whose size is measured.
 
     
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  fromPb(Entity entityPb) 
  
    
public   static   Entity   fromPb ( Entity   entityPb )  
  
    
      
        Parameter  
      
        Name Description  
      
        entityPbEntity  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        Entity  
     
  
  newBuilder(Entity copyFrom) 
  
    
public   static   Entity . Builder   newBuilder ( Entity   copyFrom )  
  
    
      
        Parameter  
      
        Name Description  
      
        copyFromEntity  
     
  
  
  newBuilder(Key key) 
  
    
public   static   Entity . Builder   newBuilder ( Key   key )  
  
    
      
        Parameter  
      
        Name Description  
      
        keyKey  
     
  
  
  newBuilder(Key key, FullEntity<?> copyFrom) 
  
    
public   static   Entity . Builder   newBuilder ( Key   key ,   FullEntity <? >  copyFrom )  
  
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    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 2025-10-29 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 2025-10-29 UTC."],[],[]]