Reputation: 692
I have a big class containing a lot of definitions. Is there a way to move/create/extract a structure using IntelliJs build in features?
So i can keep the references to those fields without having to add qualifiers for all usages?
Current is case:
public static class Tables {
public final static String METADATA_CREATE_TS = "create_ts";
public final static String TABLE_1_ID;
public final static String TABLE_1_NAME;
public final static String TABLE_1_INTERNAL_ID;
public final static String TABLE_1_CUSTOMER_ID;
.
.
.
public final static String TABLE_N_ID;
}
How it should look like:
public static class Tables {
public final static String METADATA_CREATE_TS = "create_ts";
public static class Table1 {
public final static String TABLE_1_ID;
public final static String TABLE_1_NAME;
public final static String TABLE_1_INTERNAL_ID;
public final static String TABLE_1_CUSTOMER_ID;
}
}
Upvotes: 1
Views: 727
Reputation: 510
Upvotes: 3
Reputation: 692
This is doable with a little bit of trickery.
You can use F6 in IntelliJ to move a set number of fields to a new class. After you created the new class you can than select all of the newly created classes and press F6 again to make all of those classes an inner class of a different class, which solved my overall goal.
Upvotes: 0