#Java_Programming

Damn.. Seems like I made a mistake.
Need to switch to Java programming since my university uses it for some of the classes.

Java record withers what and when http://steinar.bang.priv.no/?p=650 #noxp #java_programming #beans #boiler_plate #builders #builder_pattern #fluent_api #immutability #java #lombok #programming This blog post is the result of searching the internet to find out what Java records with “withers” will look like and in what version of Java records with withers will arrive. In addition, while trying to figure out Java withers, I discovered that reforming my current beans with builders into records wi
Java record withers what and when

This blog post is the result of searching the internet to find out what Java records with “withers” will look like and in what version of Java records with withers will arrive. In addit…

Steinar Bangs blogg
Build beans better with builders http://steinar.bang.priv.no/?p=480 #java_programming #beans #boiler_plate #builders #builder_pattern #fluent_api #immutability #java #lombok #programming Builders provide a nice, if verbose, way to create immutable java beans. The upsides are a nice syntax for creating immutable beans, and a way to provide copy-on-write behaviour for immutable objects. The downsides are the need for verbose boilerplate code, approximately doubling the code size of the bean sourc
Build beans better with builders

Edit: I no longer use beans with builders, I Build Java records with builders Builders provide a nice, if verbose, way to create immutable java beans. The upsides are a nice syntax for creating imm…

Steinar Bangs blogg
Chaining Optionals using flatMap and map http://steinar.bang.priv.no/?p=461 #java_programming #flatmap #functional_programming #java #java8 #map #optional #orelse #programming The blog post How I learnt to like Optional shows an example of how to chain Optional values safely, using Optional.orElse() to provide empty objects for the next level in the chain. This blog post uses Optional.flatMap() and Optional.map(), to achieve the same thing, without having to create the empty objects, and withou
Chaining Optionals using flatMap and map

Steinar Bangs blogg
How I learnt to like Optional http://steinar.bang.priv.no/?p=450 #java_programming #bloat #functional_programming #java #java8 #java_bloat #nosuchelementexception #nullpointerexception #optional #orelse #orelsethrow #programming I used to see Optional<Something> as a completely useless addition to Java, adding to the bloat of Java without being any clearer than checking if a reference is null. I have changed my mind, and now think Optional<> can be useful in making code simpler, easier to under
How I learnt to like&nbsp;Optional

Steinar Bangs blogg
Composing applications with karaf features http://steinar.bang.priv.no/?p=310 #apache_karaf #java_programming #declarative_services #derby #jdbc #karaf #liquibase #osgi #osgi_services #paxjdbc #paxjdbcconfig #postgresql I create web applications by first creating a set of OSGi bundles that form the building blocks of the application, and then use karaf features to pull the building blocks together to create complete applications that run inside apache karaf. The bundles are (in order of initial
Composing applications with karaf&nbsp;features

Steinar Bangs blogg
How to get test coverage back in sonarcloud maven builds http://steinar.bang.priv.no/?p=353 #java_programming #github #jacoco #maven #sonarcloud #test_coverage #travisci I use travis-ci to build my github projects and use sonarcloud to do analysis of the builds. In the start of January 2020, the test coverage percentage on all sonarcloud projects suddenly dropped to 0%. This blog post explains why coverage percentage dropped to 0% and how to get the test coverage back in the … Continue reading
How to get test coverage back in sonarcloud maven&nbsp;builds

Steinar Bangs blogg
Simplified REST APIs from karaf using Jersey http://steinar.bang.priv.no/?p=342 #java_programming #maven #apache_karaf #declarative_services #dependency_injection #http_whiteboard #jersey #jsr330 #karaf #karafmavenplugin #mavenbundleplugin #rest_api #web_whiteboard #whiteboard I have written the Java class JerseyServlet which is intended as a base class for DS (Declarative Services) components providing Servlet services to the OSGi web whiteboard. The JerseyServlet simplifies the approach outli
Simplified REST APIs from karaf using&nbsp;Jersey

Steinar Bangs blogg
Simplified delivery of react.js from apache karaf http://steinar.bang.priv.no/?p=332 #apache_karaf #frontend #java_programming #maven #axios #bootstrap #declarative_services #frontend-maven-plugin #karaf #osgi_bundle #react-router #reactjs #redux #redux-saga #web_whiteboard_extender #webpack This article is about a new servlet base class I have created to simplify serving up javascript frontends from the OSGi web whiteboard. This article won’t go into the structure of the files that must be ser
Simplified delivery of react.js from apache&nbsp;karaf

Steinar Bangs blogg
My OSGi story http://steinar.bang.priv.no/?p=306 #apache_karaf #Eclipse #java_programming #declarative_services #eclipse #karaf #osgi #osgi_services OSGi is a Java plugin framework and module system that were initially created for supporting embdedded applications in the automotive industry. OSGi also forms the foundations for the Eclipse IDE plugin model. The plugin model of OSGi consists of components waiting for services and starting and exposing services when all of the dependencies are sat
My OSGi story

Steinar Bangs blogg