Record Class ImportInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.ImportInfo
- Record Components:
normalImports- the normal (non-static) imports.staticImports- the static imports.
- All Implemented Interfaces:
ImportsSupplier
public record ImportInfo(Set<String> normalImports, Set<String> staticImports)
extends Record
implements ImportsSupplier
Describes a collection of imports and static imports.
-
Constructor Summary
ConstructorsConstructorDescriptionImportInfo(Set<String> normalImports, Set<String> staticImports) Creates an instance of aImportInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImportInfoempty()Creates anImportInfoobject with no imports.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.imports()Gets the imports.Returns the value of thenormalImportsrecord component.Returns the value of thestaticImportsrecord component.final StringtoString()Returns a string representation of this record class.withAddedImports(ImportsSupplier importSupplier) Returns a newImportInfoobject with all imports from specified supplier added.withAddedImports(Collection<? extends ImportsSupplier> importSuppliers) Returns a newImportInfoobject with all imports from specified suppliers added.withAddedNormalImport(String normalImport) Returns a newImportInfoobject with specified normal import added.withAddedStaticImport(String staticImport) Returns a newImportInfoobject with specified static import added.
-
Constructor Details
-
ImportInfo
Creates an instance of aImportInforecord class.- Parameters:
normalImports- the value for thenormalImportsrecord componentstaticImports- the value for thestaticImportsrecord component
-
-
Method Details
-
empty
Creates anImportInfoobject with no imports.- Returns:
- the empty
ImportInfoobject.
-
imports
Description copied from interface:ImportsSupplierGets the imports.- Specified by:
importsin interfaceImportsSupplier- Returns:
- the imports.
-
withAddedNormalImport
Returns a newImportInfoobject with specified normal import added.- Parameters:
normalImport- the import to add.- Returns:
- the new and updated
ImportInfoobject.
-
withAddedStaticImport
Returns a newImportInfoobject with specified static import added.- Parameters:
staticImport- the static import to add.- Returns:
- the new and updated
ImportInfoobject.
-
withAddedImports
Returns a newImportInfoobject with all imports from specified supplier added.- Parameters:
importSupplier- the imports to add.- Returns:
- the new and updated
ImportInfoobject.
-
withAddedImports
Returns a newImportInfoobject with all imports from specified suppliers added.- Parameters:
importSuppliers- the imports to add.- Returns:
- the new and updated
ImportInfoobject.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
normalImports
Returns the value of thenormalImportsrecord component.- Returns:
- the value of the
normalImportsrecord component
-
staticImports
Returns the value of thestaticImportsrecord component.- Returns:
- the value of the
staticImportsrecord component
-