-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add options to generator params * Add validate method option
- Loading branch information
1 parent
f2ef10c
commit 0839006
Showing
8 changed files
with
195 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 42 additions & 7 deletions
49
src/main/java/com/github/junkfactory/innerbuilder/GeneratorParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,51 @@ | ||
package com.github.junkfactory.innerbuilder; | ||
|
||
import com.intellij.codeInsight.generation.PsiFieldMember; | ||
import com.github.junkfactory.innerbuilder.ui.JavaInnerBuilderOption; | ||
import com.intellij.openapi.editor.Editor; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.psi.PsiElementFactory; | ||
import com.intellij.psi.PsiFile; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
record GeneratorParams(Project project, | ||
PsiFile file, | ||
Editor editor, | ||
List<PsiFieldMember> selectedFields, | ||
PsiElementFactory psiElementFactory) { | ||
PsiParams psi, | ||
Set<JavaInnerBuilderOption> options) { | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static final class Builder { | ||
private Project project; | ||
private Editor editor; | ||
private PsiParams psi; | ||
private Set<JavaInnerBuilderOption> options; | ||
|
||
private Builder() { | ||
} | ||
|
||
public Builder project(Project project) { | ||
this.project = project; | ||
return this; | ||
} | ||
|
||
public Builder editor(Editor editor) { | ||
this.editor = editor; | ||
return this; | ||
} | ||
|
||
public Builder psi(PsiParams psi) { | ||
this.psi = psi; | ||
return this; | ||
} | ||
|
||
public Builder options(Set<JavaInnerBuilderOption> options) { | ||
this.options = options; | ||
return this; | ||
} | ||
|
||
GeneratorParams build() { | ||
return new GeneratorParams(project, editor, psi, options); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.