Coder Social home page Coder Social logo

tlinkowski / unij Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 3.0 718 KB

Universal facade of JDK 9+ API, focused on Collection factory methods

Home Page: http://unij.tlinkowski.pl/

License: Apache License 2.0

Java 59.25% Groovy 31.07% Kotlin 9.68%
backport collectors facade immutable-collections java jdk jdk11 jdk8 library

unij's People

Contributors

tlinkowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

unij's Issues

Create UnmodifiableSetFactory and related classes

  • interface UnmodifiableSetFactory
  • abstract test AbstractUnmodifiableSetFactorySpec in unij-test
  • JDK10 implementation Jdk10UnmodifiableSetFactory
  • JDK10 test Jdk10UnmodifiableSetFactorySpec
  • add UniSets utility class
  • add UniSetsSpec test

Add sample projects

  • pl.tlinkowski.unij.sample.enduser
  • pl.tlinkowski.unij.sample.lib
  • pl.tlinkowski.unij.sample.lib.usage.eclipse
  • pl.tlinkowski.unij.sample.lib.usage.guava
  • pl.tlinkowski.unij.sample.lib.usage.jdk8
  • pl.tlinkowski.unij.sample.lib.usage.jdk11

Can't sync to Maven Central

Maven Central reports missing Javadoc JARs in all modules.

Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.collect.jdk8/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.collect.jdk10/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.bundle.guava_jdk8/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.api/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.bundle.eclipse_jdk8/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.misc.jdk11/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.api/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.bundle.jdk8/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.misc.jdk8/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.collect.eclipse/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.test/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.service.collect.guava/0.1.0'
Missing: no javadoc jar found in folder '/pl/tlinkowski/unij/pl.tlinkowski.unij.bundle.jdk11/0.1.0'
Dropping existing partial staging repository.

Related to tlinkowski/basic-annotations#13.

Support loading priority for UniJ services

If it so happens that there's more than one UniJ service, they should be selected according to some priority.

Options:

  • priority inside an annotation, e.g. @UniJService(priority = 10)
  • priority as configuration, e.g. in a ".properties" file:
    service1.priority = 10
    service2.priority = 20
    

Blocked by #18.

Fix `module-info.java` for `unij-bundle-*`

Find out if module-info.java in unij-bundle-* should declare uses. For sure, module-info.java should somehow reflect the runtimeOnly dependency we have on unij-collect-* and unij-misc-*.

Related to #40.

Create MiscellaneousApiProvider and related classes

  • interface MiscellaneousApiProvider
  • abstract test AbstractMiscellaneousApiProviderSpec in unij-test
  • JDK11 implementation Jdk11MiscellaneousApiProvider
  • JDK11 test Jdk11MiscellaneousApiProviderSpec
  • add methods to UniCollectors class
  • add feature methods to UniCollectorsSpec class

Introduce "bundle" modules

In spirit of "convention over configuration", "bundle" modules have no own source code, and simply aggregate other modules:

  • bundle-jdk8: collect-jdk8 + misc-jdk8
  • bundle-jdk11: collect-jdk10 + misc-jdk11 (this bundle would make sense only when using a library based on unij-api)
  • bundle-guava-jdk8: collect-guava + misc-jdk8
  • bundle-guava-jdk11: collect-guava + misc-jdk11
  • bundle-eclipse-jdk8: collect-eclipse + misc-jdk8
  • bundle-eclipse-jdk11: collect-eclipse + misc-jdk11

Other bundles can be added per request.

Related to #31.

Create UnmodifiableMapFactory and related classes

  • interface UnmodifiableMapFactory
  • abstract test AbstractUnmodifiableMapFactorySpec in unij-test
  • JDK10 implementation Jdk10UnmodifiableMapFactory
  • JDK10 test Jdk10UnmodifiableMapFactorySpec
  • add UniMaps utility class
  • add UniMapsSpec test

Add tests for modulepath service registration

Currently, our specs only test if a service is properly registered on classpath ("proper service is registered on classpath"). It's easy to check, because we're testing on classpath only (due to Groovy 2). However, we should find some way to also test if a service is properly registered on modulepath (and generally test everything on modulepath too - should be possible with Groovy 3).

Architecture improvements

Make the architecture depend on two parts - "collect" and "misc":

  • rename unij-core to unij-api
  • extract unij-collect-jdk10 and unij-misc-jdk11 from unij-jdk11; leave unij-bundle-jdk11 as simple aggregation
  • extract unij-collect-jdk8 and unij-misc-jdk8 from unij-jdk8; leave unij-bundle-jdk8 as simple aggregation
  • rename unij-guava to unij-collect-guava
  • rename unij-eclipse to unij-collect-eclipse

Change artifact names to module names

Apply @sormuras' naming convention to this project:

  • unij-api -> pl.tlinkowski.unij.api
  • unij-bundle-eclipse-jdk8 -> pl.tlinkowski.unij.bundle.eclipse_jdk8
  • unij-bundle-guava-jdk8 -> pl.tlinkowski.unij.bundle.guava_jdk8
  • unij-bundle-jdk11 -> pl.tlinkowski.unij.bundle.jdk11
  • unij-bundle-jdk8 -> pl.tlinkowski.unij.bundle.jdk8
  • unij-collect-eclipse -> pl.tlinkowski.unij.service.collect.eclipse
  • unij-collect-guava -> pl.tlinkowski.unij.service.collect.guava
  • unij-collect-jdk10 -> pl.tlinkowski.unij.service.collect.jdk10
  • unij-collect-jdk8 -> pl.tlinkowski.unij.service.collect.jdk8
  • unij-misc-jdk11 -> pl.tlinkowski.unij.service.misc.jdk11
  • unij-misc-jdk8 -> pl.tlinkowski.unij.service.misc.jdk8
  • unij-service-api -> pl.tlinkowski.unij.service.api
  • unij-test -> pl.tlinkowski.unij.test

Related to tlinkowski/tlinkowski-superpom#64.

[unij-test] Tighten the Spock specs

We currently don't yet test if:

  1. null elements are indeed disallowed in collections (all currently tested methods, as parametrized tests)
  2. duplicate keys in MapProvider.of() and MapProvider.ofEntries() throw errors
  3. factory.of() returns the same instance as empty.collect(factory.collector()), factory.copyOf() and factory.of(array)

There's probably more (read the JDK's unmodifiable List/Set/Map specs to discover).

Clean up `README.md`

  • shorter
  • cleaner layout ("For End User", "For Library Maintainer", "For Binding Provider" sections?)
  • perhaps separated into more files?
  • add table of contents

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.