Model

  • The Model class provides information about a model.

  • It includes nested classesModel.Builder for building Model objects andModel.ModelLocation for specifying where to load the model from.

  • The class provides methods to retrieve model information based on its location, such as file descriptor, offset, path, or ByteBuffer.

  • Unique identifiers for the model, includingmodelId andmodelNamespace, can also be retrieved.

  • Several standard methods are inherited from thejava.lang.Object class.

public classModel extendsObject

Model information.

Nested Class Summary

classModel.BuilderBuilder class. 
class Model.ModelLocationWhere to load the model from. 

Public Method Summary

long
long
String
ByteBuffer
String
modelId()
Returns the unique model id.
long
String
modelNamespace()
Returns the model namespace.

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
finalClass<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

Public Methods

public longfileDescriptor()

Returns the model file descriptor if Model.ModelLocation was created with Model.ModelLocation.fromFileDescriptor(long, long, long). Returns0 otherwise.

public longfileOffset()

Returns the model file offset if Model.ModelLocation was created with Model.ModelLocation.fromFileDescriptor(long, long, long). Returns0 otherwise.

publicStringfilePath()

Returns the model file path if Model.ModelLocation was created with Model.ModelLocation.fromFilePath(String) or Model.ModelLocation.fromFile(File). Returnsnull otherwise.

publicByteBuffermodelBuffer()

Returns the model data if Model.ModelLocation was created with Model.ModelLocation.fromByteBuffer(ByteBuffer). Returnsnull otherwise.

publicStringmodelId()

Returns the unique model id.

public longmodelLength()

Returns the model file length if Model.ModelLocation was created with Model.ModelLocation.fromFileDescriptor(long, long, long). Returns0 otherwise.

publicStringmodelNamespace()

Returns the model namespace.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.