Class InclusionSpecification

  • All Implemented Interfaces:

    
    public final class InclusionSpecification
    
                        

    A FileInclusionSpecification is at minimum a source-declaration from which files and directories will be included in the server pack to be generated.

    Optionally, the following values can be specified:

    • Destination

    • Inclusion-filter (regex)

    • Exclusion-filter (regex)

    • When a destination is specified, then every file and directory acquired from the source will be copied to the specified destination in the server pack, whereas otherwise the source would be copied to a destination in the server pack matching the name of the source.

    • Inclusion filters help to further limit the files and directories to be included from the specified source. Any file and directory matching this filter will be included.

    • Exclusion filters help to further limit the files and directories to be included from the specified source. Any file and directory matching this filter will NOT be included.

    Author:

    Griefed

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getSource() What to copy, relative to the modpack directory.
      final Unit setSource(String value) What to copy, relative to the modpack directory.
      final String getDestination() Where it lands in the server pack, or null to keep the source's own name.
      final Unit setDestination(String value) Where it lands in the server pack, or null to keep the source's own name.
      final String getInclusionFilter() Regex narrowing which files under source are copied, or null for all of them.
      final Unit setInclusionFilter(String value) Regex narrowing which files under source are copied, or null for all of them.
      final String getExclusionFilter() Regex removing files that inclusionFilter would otherwise have kept, or null for none.
      final Unit setExclusionFilter(String value) Regex removing files that inclusionFilter would otherwise have kept, or null for none.
      final Boolean hasInclusionFilter() Whether this inclusion-spec has an Inclusion-Filter present.
      final Boolean hasExclusionFilter() Whether this inclusion-spec has an Exclusion-Filter present.
      final Boolean hasDestination() Whether this inclusion-spec has a destination in the server-pack-to-be set.
      final Boolean isGlobalFilter() Whether this inclusion-spec is a global filter to be applied to every inclusion.
      final HashMap<String, String> asHashMap() Get this inclusion-spec as a hashmap.
      Boolean equals(Object other) Value-equality across source, destination and both filters, so two inclusions describing the same files compare equal — enabling list-deduplication and the editor's dirty-check.
      Integer hashCode() Hash-code consistent with equals, derived from source, destination and both filters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InclusionSpecification

        InclusionSpecification(String source, String destination, String inclusionFilter, String exclusionFilter)
    • Method Detail

      • getSource

         final String getSource()

        What to copy, relative to the modpack directory.

      • setSource

         final Unit setSource(String value)

        What to copy, relative to the modpack directory.

      • getDestination

         final String getDestination()

        Where it lands in the server pack, or null to keep the source's own name.

      • setDestination

         final Unit setDestination(String value)

        Where it lands in the server pack, or null to keep the source's own name.

      • getInclusionFilter

         final String getInclusionFilter()

        Regex narrowing which files under source are copied, or null for all of them.

      • setInclusionFilter

         final Unit setInclusionFilter(String value)

        Regex narrowing which files under source are copied, or null for all of them.

      • getExclusionFilter

         final String getExclusionFilter()

        Regex removing files that inclusionFilter would otherwise have kept, or null for none.

      • setExclusionFilter

         final Unit setExclusionFilter(String value)

        Regex removing files that inclusionFilter would otherwise have kept, or null for none.

      • hasDestination

         final Boolean hasDestination()

        Whether this inclusion-spec has a destination in the server-pack-to-be set.

      • isGlobalFilter

         final Boolean isGlobalFilter()

        Whether this inclusion-spec is a global filter to be applied to every inclusion. A global filter requires the source to be empty and/or blank and an inclusion- or exclusion-filter to be set.

      • equals

         Boolean equals(Object other)

        Value-equality across source, destination and both filters, so two inclusions describing the same files compare equal — enabling list-deduplication and the editor's dirty-check.

      • hashCode

         Integer hashCode()

        Hash-code consistent with equals, derived from source, destination and both filters.