Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
    
    GetField
    abstract class GetField
    
    Provide access to the persistent fields read from the input stream.
    Summary
    
    
      
        
          | Public methods | 
        
          | abstract Boolean | Return true if the named field is defaulted and has no value in this stream. | 
        
          | abstract Boolean | Get the value of the named boolean field from the persistent field. | 
        
          | abstract Byte | Get the value of the named byte field from the persistent field. | 
        
          | abstract Char | Get the value of the named char field from the persistent field. | 
        
          | abstract Double | Get the value of the named double field from the persistent field. | 
        
          | abstract Float | Get the value of the named float field from the persistent field. | 
        
          | abstract Int | Get the value of the named int field from the persistent field. | 
        
          | abstract Any! | Get the value of the named Object field from the persistent field. | 
        
          | abstract Long | Get the value of the named long field from the persistent field. | 
        
          | abstract Short | Get the value of the named short field from the persistent field. | 
        
          | abstract ObjectStreamClass! | Get the ObjectStreamClass that describes the fields in the stream. | 
      
    
    Public constructors
    
    Public methods
    
      defaulted
      
      abstract fun defaulted(name: String!): Boolean
      Return true if the named field is defaulted and has no value in this stream.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
        
      
      
        
          
            | Return | 
          
            | Boolean | true, if and only if the named field is defaulted | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if namedoes not correspond to a serializable field | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Boolean
): Boolean
      Get the value of the named boolean field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Boolean: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Boolean | the value of the named booleanfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Byte
): Byte
      Get the value of the named byte field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Byte: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Byte | the value of the named bytefield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Char
): Char
      Get the value of the named char field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Char: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Char | the value of the named charfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Double
): Double
      Get the value of the named double field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Double: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Double | the value of the named doublefield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Float
): Float
      Get the value of the named float field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Float: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Float | the value of the named floatfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Int
): Int
      Get the value of the named int field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Int: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Int | the value of the named intfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Any!
): Any!
      Get the value of the named Object field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Any!: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Any! | the value of the named Objectfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Long
): Long
      Get the value of the named long field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Long: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Long | the value of the named longfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      get
      
      abstract fun get(
    name: String!, 
    val: Short
): Short
      Get the value of the named short field from the persistent field.
      
        
          
            | Parameters | 
          
            | name | String!: the name of the field | 
          
            | val | Short: the default value to use if namedoes not have a value | 
        
      
      
        
          
            | Return | 
          
            | Short | the value of the named shortfield | 
        
      
      
        
          
            | Exceptions | 
          
            | java.io.IOException | if there are I/O errors while reading from the underlying InputStream | 
          
            | java.lang.IllegalArgumentException | if type of nameis not serializable or if the field type is incorrect | 
        
      
     
    
      getObjectStreamClass
      
      abstract fun getObjectStreamClass(): ObjectStreamClass!
      Get the ObjectStreamClass that describes the fields in the stream.
      
        
          
            | Return | 
          
            | ObjectStreamClass! | the descriptor class that describes the serializable fields | 
        
      
     
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [null,null,["Last updated 2025-02-10 UTC."],[],[]]