Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, May 26, 2020

How to change a default Java version in macOS X

Let me check the current Java version
$ java -version
java version "13.0.2" 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)

In macOS Java is installed as part of /Library/Java/JavaVirtualMachines folder.

Let me go there.
$ cd /Library/Java/JavaVirtualMachines/

I want to set Java 11 as the default Java version. Let me check what all I've installed in my system.
$ pwd
/Library/Java/JavaVirtualMachines 

$ ls
jdk-11.0.7.jdk jdk-13.0.2.jdk jdk1.8.0_201.jdk

Let me set the default Java version to jdk-11.0.7.jdk
$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home/
$ export PATH=$JAVA_HOME/bin:$PATH

The above changes are applicable only for the current shell. To change permanently for all the shells you need set those two lines in the .bash_profile

First, go to the user home directory to run the below command
$ cd ~

$ pwd
/Users/kondal

$vim .bash_profile

Append the above two lines in the .bash_profile at the end, and save and exit.

All set.

Check again!

$ java --version
java 11.0.7 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

Good to go!!

Monday, November 26, 2018

Should we migrate projects from Java 8 to Java 9 or 10

If you're on Java 8, you might be thinking should we migrate the projects from Java 8 to Java 9 or 10?

Big NO!!

It doesn’t worth the effort. It’s better if you migrate your projects directly to Java 11 which is an LTS version.

Java 9 and Java 10 are non-LTS versions.

“For product releases after Java SE 8, Oracle will designate a release, every three years, as a Long-Term-Support (LTS) release. Java SE 11 (18.9 LTS) is an LTS release. For the purposes of Oracle Premier Support, non‑LTS releases are considered a cumulative set of implementation enhancements of the most recent LTS release. Once a new feature release is made available, any previous non‑LTS release will be considered superseded. For example, Java SE 9 was a non‑LTS release and immediately superseded by Java SE 10 (also non‑LTS), Java SE 10 in turn is immediately superseded by Java SE 11. Java SE 11 however is an LTS release, and therefore Oracle Customers will receive Oracle Premier Support and periodic update releases, even after Java SE 12 is released.”

For long-term support, Oracle is recommending remaining on Java 8 or move to Java 11.  Refer to the following:


Java 8 Release support:
Premier support: March 2022
Extended support: March 2025

Java 9:
Premier support: March 2018
Extended support: Not available

Java 10:
Premier support: Sept 2018
Extended support: Not available

Java 11:
Premier support: Sept 2023
Extended support: Sept 2026

Tuesday, May 31, 2016

Eclipse RCP remote debugging

You have two Eclipse applications here

1. Target eclipse  - which you've shipped to client
2. Source eclipse -  source code application


Step 1: Launch target eclipse in debug mode

Note: Here AppceleratorStudio is my Eclipse-based product

Go to your eclipse:
$cd /Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/MacOS

Then run the following command.

$./AppceleratorStudio -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8989

8989 is the port number where you're remote eclipse debug service is running on.

The moment you run the above command, you will get to see "Listening for transport dt_socket at address: 8989" mesasge on the console.



Step# 2: Launch your source eclipse.

  1. Select a project from the project explorer
  2. From toolbar debug menu, go to "Debug configurations..."
  3. Go to 'Remote Java Application'
  4. Right-click 'New'
  5. And provide the configuration something like below.
  6. Click on 'Apply' and 'Debug'







Monday, October 12, 2015

How to find the product code for the installed MSI file in windows

Run below command from power shell to see.

PS C:\Users\Admin> get-wmiobject -class Win32_Product


IdentifyingNumber : {32A3A4F4-B792-11D6-A78A-00B0D0170400}
Name              : Java SE Development Kit 7 Update 40
Vendor            : Oracle
Version           : 1.7.0.400
Caption           : Java SE Development Kit 7 Update 40

IdentifyingNumber : {32A3A4F4-B792-11D6-A78A-00B0D0170760}
Name              : Java SE Development Kit 7 Update 76
Vendor            : Oracle
Version           : 1.7.0.760
Caption           : Java SE Development Kit 7 Update 76

IdentifyingNumber : {32A3A4F4-B792-11D6-A78A-00B0D0170800}
Name              : Java SE Development Kit 7 Update 80
Vendor            : Oracle
Version           : 1.7.0.800
Caption           : Java SE Development Kit 7 Update 80

IdentifyingNumber : {64A3A4F4-B792-11D6-A78A-00B0D0170400}
Name              : Java SE Development Kit 7 Update 40 (64-bit)
Vendor            : Oracle
Version           : 1.7.0.400
Caption           : Java SE Development Kit 7 Update 40 (64-bit)

IdentifyingNumber : {64A3A4F4-B792-11D6-A78A-00B0D0170800}
Name              : Java SE Development Kit 7 Update 80 (64-bit)
Vendor            : Oracle
Version           : 1.7.0.800
Caption           : Java SE Development Kit 7 Update 80 (64-bit)


IdentifyingNumber  number represents the product code.

Tuesday, May 5, 2015

XML validation w.r.t to schema

                                                                                                         
import java.io.File;                                                                                      
import java.io.IOException;                                                                              
                                                                                                         
import javax.xml.XMLConstants;                                                                            
import javax.xml.transform.stream.StreamSource;                                                          
import javax.xml.validation.Schema;                                                                      
import javax.xml.validation.SchemaFactory;                                                                
import javax.xml.validation.Validator;                                                                    
                                                                                                         
import org.xml.sax.ErrorHandler;                                                                          
import org.xml.sax.SAXException;                                                                          
import org.xml.sax.SAXParseException;                                                                    
                                                                                                         
public class SchemaValidator                                                                              
{                                                                                                        
public static void main(String[] args)                                                                
{                                                                                                    
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);            
try                                                                                              
{                                                                                                
Schema schema = factory.newSchema(new File("C:\\myschema.xsd"));                              
Validator validator = schema.newValidator();                                                  
validator.setErrorHandler(new SimpleErrorHandler());                                          
try                                                                                          
{                                                                                            
validator.validate(new StreamSource(new File("C:\\myxmldata.xml")));                      
}                                                                                            
catch (SAXException e)                                                                        
{                                                                                            
e.printStackTrace();                                                                      
}                                                                                            
catch (IOException e)                                                                        
{                                                                                            
e.printStackTrace();                                                                      
}                                                                                            
}                                                                                                
catch (SAXException e)                                                                            
{                                                                                                
e.printStackTrace();                                                                          
}                                                                                                
}                                                                                                    
}                                                                                                        
                                                                                                         
class SimpleErrorHandler implements ErrorHandler                                                          
{                                                                                                        
public void warning(SAXParseException e) throws SAXException                                          
{                                                                                                    
System.out.println(e.getMessage());                                                              
// create problem marker                                                                          
}                                                                                                    
                                                                                                         
public void error(SAXParseException e) throws SAXException                                            
{                                                                                                    
System.out.println(e.getMessage());                                                              
// create problem marker                                                                          
}                                                                                                    
                                                                                                         
public void fatalError(SAXParseException e) throws SAXException                                      
{                                                                                                    
System.out.println(e.getMessage());                                                              
// create problem marker                                                                          
}                                                                                                    
}                                                                                                        
                                                                                                            

Thursday, November 27, 2014

Changing the Eclipse Java thread time out value


Did you ever face below kind of issue while starting your eclipse product ? 

!ENTRY org.eclipse.osgi 2 0 2014-11-28 11:17:57.835
!MESSAGE While loading class "com.kk.tool.model.KContainer", thread "Thread[main,6,main]" timed out waiting (5015ms) for thread "Thread[Thread-3,5,main]" to finish starting bundle "com.kk.tool_6.0.190.DEV_v201411271801 [664]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "com.kk.tool.model.KContainer" may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle "reference:file:dropins/com.kk.tool_6.0.190.DEV_v201411271801.jar" by thread "Thread-3


There are two majors reasons for this.
1. Real dead lock would have occurred
2. Your product might have lot of bundles and each one of them might have dependencies on other plugins startup. Because of this, eclipse startup will be delayed.

If it is (1), we need to identify the root cause for a dead lock and fix it.

In general, OSGI controlling java threads time out by 5000 ms by default. We can control this time out by osgi parameter which need to be configured in the config.ini file.

equinox.statechange.timeout=8000

You can find config.ini file in the configuration folder of eclipse directory.
<eclipse>/configuration/config.ini

Caution: Don't jump strait to the timeout solution with out really looking at the dead lock possibility, 99% of time problem might be there with our code only!!!!

Resources:



Monday, October 13, 2014

How do I know with which version of Java eclipse got launched ?

Eclipse would have launched with some JRE support, to understand and know which version of java is used and from where it picked up. Follow these steps.

Go to Help->About Eclipse -> Installation Details -> Configuration

Look for below parameters:
java.version=1.7.0_55
java.home=C:\Program Files\Java\jre7
eclipse.vm=C:\Program Files\Java\jre7\bin\javaw.exe

Where can I find configured default Java/JRE in my Mac OS X system

Go to below location to find the installed JDK versions in your mac machine.

/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/

Monday, September 15, 2014

java.lang.OutOfMemoryError: unable to create new native thread

One of the developer reported "java.lang.OutOfMemoryError: unable to create new native thread" while working with eclipse on his application.

Below is the error log.
java.lang.OutOfMemoryError: unable to create new native thread
                at java.lang.Thread.start0(Native Method)
                at java.lang.Thread.start(Unknown Source)
                at java.lang.ref.Finalizer$1.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.lang.ref.Finalizer.forkSecondaryFinalizer(Unknown Source)
                at java.lang.ref.Finalizer.runFinalization(Unknown Source)
                at java.lang.Runtime.runFinalization0(Native Method)
                at java.lang.Runtime.runFinalization(Unknown Source)
                at java.lang.System.runFinalization(Unknown Source)
                at org.eclipse.ui.internal.ide.application.IDEIdleHelper$3.run(IDEIdleHelper.java:182)

                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


This is what i can think why he encountered with this issue.

User is running on 32 bit machine with 
Since he is running on 32 bit machine, you need to allocate –Xmx and -XX:PermSize carefully. Since 32 bit machines can address maximum of 4GB address space.

Since we allocated -Xmx is 1024m and -XX:PermSize is 512m, there is very less space is remaining to create a new Java native threads by OS.

To make it work, reduce -XX:PermSize to 256m and –Xmx to 512m(unless 1024 is required).


Wednesday, July 16, 2014

Executing batch file through Java

Batch file has to perform below actions.

1. Change the directory for a given path
2. start the node sever
3. Exit the command window

>cd D:\nodev0.18
>node app.js console
>exit

FileName: Myfile.bat
Batch file defined with variable arguments like below.

cd %1
%2 app.js console
exit

Java code for invocation:
String executePath = "cmd /c start Myfile.bat"
   Runtime.getRuntime().exec(executePath);

Monday, April 7, 2014

How to check Installed Java is a 32 bit or 64 bit version ?


If you have installed JDK, Java would have registered in the system environment variables.

Go to command prompt and type “java –version”

C:\Users\kh1205>java -version
 java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

If it’s a 64 bit Java, you will be finding “64-Bit Server VM” in the above line.

If it’s a 32 bit java, you will be finding “Client VM” in the above line.

I have another JDK configured in my system, for which I wanted to check java version.
For example, other version of java is available in the location “C:\Program Files (x86)\Java\jdk1.6.0_31

C:\Program Files (x86)\Java\jdk1.6.0_31\bin>java -version
 java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)


“Client VM” in the last line tell you that,  JDK is a 32 bit version.

Wednesday, February 19, 2014

Identifying a deadlock in your application using JConsole

It's very simple!!  You need not setup anything for this. JPS and JConsole comes with JDK toolkit.

Step 1:
Got to command prompt and type 'jps' command. This will tell you the currently running java process id's.

Example:
C:\Users\kh1205>jps

7620 org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
7048 Main
5740 Jps


Step 2:
Open jconsole using your application process id, in my case 7048 is my eclipse application process id.

Example:
C:\Users\kh1205>jconsole 7048

This will launch jconsole window with various sections.

Step 3:
Navigate to Threads section in jconsole window, and navigate through main thread(ex:main) and worker threads(ex: worker-1, worker-2). In one of these threads, your application is in waiting state.





Thursday, February 6, 2014

Run time data areas - JVM Memory model

I love to share an excellent article from Point software, It's just a brilliant composition and easy to understand with diagrams.

Every developer gets once confronted by Java memory questions like: What size should I define for the Heap space? An OutOfMemoryError covers which part of the runtime data area? In the Heap, PermGen, or Thread? And how do I solve it?

Java Memory Model

The Java memory model is specified in the latest JVM specification, Java SE 7 Edition, and mainly in the chapters “2.5 Runtime Data Areas” and “2.6 Frames”. In a nutshell primitive, object and class data are stored in 3 different memory areas: heap space, method area and native are.
The heap space holds object data, the method area holds class code, and the native area holds references to the code and object data.
The method area is also known as the permanent generation space (PermGen). All class data are loaded into this memory space. This includes the field and method data and the code for the methods and constructors.
[UPDATE]
Oracle has planned in JDK 7 to completely remove the PermGen space from the JVM. Reason is the consolidation of HotSpot and JRockit. As a result the method area will be part of the operating system’s native heap.
All objects being instantiated during runtime are stored in the heap space. The heap space again is divided into several parts: eden, survivor, and old generation Space.
Method executions are within a thread. Local variables of primitive types and references are stored here. The references for example points to Objects like String stored in the Heap space. Here is a video demonstrating the interaction between a stack and the heap.
For a better understanding let’s have a look at another example code:
The data are then stored like this:
With the JConsole tool it is possible to view the memory allocations in the heap, the number of threads and loaded classes of a running Java application (e.g. Eclipse):

Java Memory Architecture

There is an excellent white paper about Memory Management in the Java
HotSpot™ Virtual Machine
. It describes about the automatic memory management handle using garbage collection.
The Java memory architecture consists of the following parts:

Heap memory

Since objects are stored in the heap part it is worth to have a closer look. The heap space itself is again separated into several spaces:
  • Young generation with eden and survivor space
  • Old Generation with tenured space
Each space harbors objects with different life cycles:
  • New/short-term objects are instantiated in the eden space.
  • Survived/mid-term objects are copied from the eden space to the survivor space.
  • Tenured/long-term objects are copied from the survivor to the old generation space.
By separating objects by their life time allows a shorter time consumption of the minor garbage collection and in return there is more cpu time for the application.
The reason is that in Java – unlike C – memory is freed (by destroying objects) automatically by two different garbage collectors: a minor and major garbage collection.
Instead of validating all objects in the heap – whether it can be destroyed or not – the minor garbage collector marks undestroyed objects with a garbage count. After a certain count the object is move to the old generation space.
A more detailed blog of the garbage collection will be discussed in another blog. For now it is sufficient to know that there are two garbage collectors.

OutOfMemoryError – but where?

Having this memory architecture in mind also helps to understand the different OutOfMemoryErrors like:
  1. Exception in thread “main”: java.lang.OutOfMemoryError: Java heap space
    Reason: an object could not be allocated into the heap space.

  2. Exception in thread “main”: java.lang.OutOfMemoryError: PermGen space
    Reason: classes and methods could not be loaded into the PermGen space. This occurs when an application requires a lot of classes e.g. in various 3rd party libraries.

  3. Exception in thread “main”: java.lang.OutOfMemoryError: Requested array size exceeds VM limit
    Reason: this occurs when an arrays is created larger than the heap size.

  4. Exception in thread “main”: java.lang.OutOfMemoryError: request bytes for . Out of swap space?
    Reason: this occurs when an allocation from the native heap failed and might be close to its limit. The indicates the source of the module where this error occurs.

  5. Exception in thread “main”: java.lang.OutOfMemoryError: (Native method)
    Reason: this error indicates that the problem originates from a native call rather than in the JVM.

Useful Links

Resources:

Thursday, January 16, 2014

Java Type Erasure: Cannot perform instanceof check against parameterized type

Can we use something like this ?

public Object[] getElements(Object inputElement) {
if (inputElement instanceof List<Parameter>) {
return ((List<Parameter>) inputElement).toArray();
}
return new Object[] {};
}

No!!!!

Compiler Error message:
Cannot perform instanceof check against parameterized type List<Parameter>. Use the form List<?> instead since further generic type information will be erased at runtime


It's telling us to use List<?> more generic type rather than specific List<Parameter>.

public Object[] getElements(Object inputElement) {
if (inputElement instanceof List<?>) {
return ((List<?>) inputElement).toArray();
}
return new Object[] {};
}


Why?

In simple terms, generic types will be erased at compile time. During the type erasure process, the Java compiler erases all type parameters and replaces each with its first bound if the type parameter is bounded, or Object if the type parameter is unbounded.

It means, the .class file or generated byte code will not have any generic type information.


Below is the code after applying type erasure by compiler.

public Object[] getElements(Object inputElement) {
if (inputElement instanceof List) {
return ((List) inputElement).toArray();
}
return new Object[] {};
}


Other example from SUN docs:

public class Node<T> {

    private T data;
    private Node<T> next;

    public Node(T data, Node<T> next) }
        this.data = data;
        this.next = next;
    }

    public T getData() { return data; }
    // ...
}

Because the type parameter T is unbounded, the Java compiler replaces it with Object:

public class Node {

    private Object data;
    private Node next;

    public Node(Object data, Node next) {
        this.data = data;
        this.next = next;
    }

    public Object getData() { return data; }
    // ...
}


In the following example, the generic Node class uses a bounded type parameter:

public class Node<T extends Comparable<T>> {

    private T data;
    private Node<T> next;

    public Node(T data, Node<T> next) {
        this.data = data;
        this.next = next;
    }

    public T getData() { return data; }
    // ...
}
The Java compiler replaces the bounded type parameter T with the first bound class, Comparable:

public class Node {

    private Comparable data;
    private Node next;

    public Node(Comparable data, Node next) {
        this.data = data;
        this.next = next;
    }

    public Comparable getData() { return data; }
    // ...
}


Resources:
http://docs.oracle.com/javase/tutorial/java/generics/erasure.html

Wednesday, January 8, 2014

Converting map to JSON String using Jackson API


API libraries can found here @ http://jackson.codehaus.org/

Example:

import java.util.ArrayList;
import java.util.HashMap;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class MapToJSONExample {

public static void main(String[] args) {
               
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("param1", "Hyderabad");
hashMap.put("param2", "Bangalore");

ArrayList<String> arrayList = new ArrayList<String>();
arrayList.add("hello1");
arrayList.add("hello2");
arrayList.add("hello3");

Employee employee = new Employee("Kondal", "Kolipaka");

ObjectMapper mapper = new ObjectMapper();
String writeValueAsString;
try {
writeValueAsString = mapper.writeValueAsString(hashMap);
System.out.println(writeValueAsString);

writeValueAsString = mapper.writeValueAsString(arrayList);
System.out.println(writeValueAsString);

writeValueAsString = mapper.writeValueAsString(employee);
System.out.println(writeValueAsString);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
}
}


public class Employee {

private String firstName;
private String lastName;

public Employee(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}

/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}

/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}

}

Output:
{"param1":"Hyderabad","param2":"Bangalore"}
["hello1","hello2","hello3"]
{"firstName":"Kondal","lastName":"Kolipaka"}


Just to conclude, we can use writeValueAsString(Object obj) method for any bean class which can be serializable.

Say for example, if you remove getters from Employee class, it will be throwing JsonMappingException.

No serializer found for class Employee and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS) )

Friday, January 3, 2014

JSON Schema to Model Converter


JSON schema/Example to model converter
http://www.jsonschema2pojo.org/

This supports Jackson and Google gson JSON libraries.

JSON Viewer
http://jsonviewer.stack.hu/


Example: for my project JSON example
{
  "projectName":"TestProject",

  "properties": {
    "createdBy": "Kondal Kolipaka",
    "createdTime": "21-01-2013",
    "lastModifiedTime":"21-02-2013"
  }
}


Generated Model for above Project JSON example:

package com.kk;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
"projectName",
"properties"
})
public class Project {

@JsonProperty("projectName")
private String projectName;
@JsonProperty("properties")
private Properties properties;
private Map<StringObject> additionalProperties = newHashMap<StringObject>();

@JsonProperty("projectName")
public String getProjectName() {
return projectName;
}

@JsonProperty("projectName")
public void setProjectName(String projectName) {
this.projectName = projectName;
}

@JsonProperty("properties")
public Properties getProperties() {
return properties;
}

@JsonProperty("properties")
public void setProperties(Properties properties) {
this.properties = properties;
}

@JsonAnyGetter
public Map<StringObject> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperties(String nameObject value) {
this.additionalProperties.put(namevalue);
}

}
-----------------------------------com.kk.Properties.java-----------------------------------

package com.kk;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
"createdBy",
"createdTime",
"lastModifiedTime"
})
public class Properties {

@JsonProperty("createdBy")
private String createdBy;
@JsonProperty("createdTime")
private String createdTime;
@JsonProperty("lastModifiedTime")
private String lastModifiedTime;
private Map<StringObject> additionalProperties = newHashMap<StringObject>();

@JsonProperty("createdBy")
public String getCreatedBy() {
return createdBy;
}

@JsonProperty("createdBy")
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}

@JsonProperty("createdTime")
public String getCreatedTime() {
return createdTime;
}

@JsonProperty("createdTime")
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}

@JsonProperty("lastModifiedTime")
public String getLastModifiedTime() {
return lastModifiedTime;
}

@JsonProperty("lastModifiedTime")
public void setLastModifiedTime(String lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}

@JsonAnyGetter
public Map<StringObject> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperties(String nameObject value) {
this.additionalProperties.put(namevalue);
}

}

As we can see it also generates getAdditionalProperties(), this would be very much useful later point of time if we wanted to send some additional information without really modifying the existing structure.