Kayıtlar

expose etiketine sahip yayınlar gösteriliyor

Dockerfile

Dockerfile is a text document that containes all the commands a user could call on the command line to assemble an image. Using docker build users can create ana automated build that executes several command-line instructions in succession. Whenever possible, Docker will reuse the intermediate images(cache), to accelerate the docker build process significantly. Here is the format of the Dockerfile: # Comment INSTRUCTION arguments A Dockerfile must start with a "FROM" instruction FROM  -> Used to specify the base image from your custome image USER   -> User that will run the container ADD    -> Copy some file in your current directory into some dir inside the image EXPOSE -> informs Docker that the container listens on the specified network ports at runtime RUN  -> run some commands in the container CMD -> command that will be executed when the container started WORKDIR -> The working directory of the running container E...

@SerializedName and @Expose annotations

The  @SerializedName  annotation is needed for Gson to map the JSON keys with our fields. In keeping with Java's camelCase naming convention for class member properties, it is not recommended to use underscores to separate words in a variable.  @SerializedName  helps translate between the two. @SerializedName ( "quota_remaining" ) @Expose private Integer quotaRemaining; In the example above, we are telling Gson that our JSON key  quota_remaining  should be mapped to the Java field  quotaRemaining .  If both of these values were the same, i.e. if our JSON key was  quotaRemaining  just like the Java field, then there would be no need for the  @SerializedName  annotation on the field because Gson would map them automatically. The  @Expose  annotation indicates that this member should be exposed for JSON serialization or deserialization.