signature:
public class JsonWriter { /** * Main entry point ( mostly used internally , but may be called from a Custom JSON writer ) .
 * This method will write out whatever object type it is given , including JsonObject ' s .
 * It will handle null , detecting if a custom writer should be called , array , array of
 * JsonObject , Map , Map of JsonObjects , Collection , Collection of JsonObject , any regular
 * object , or a JsonObject representing a regular object .
 * @ param obj Object to be written
 * @ param showType if set to true , the @ type tag will be output . If false , it will be
 * @ param allowRef if set to true , @ ref will be used , otherwise 2 + occurrence will be
 * output as full object .
 * @ param allowCustom if set to true , the object being called will allowed to be checked for a matching
 * custom writer to be used . This does not affect subobjects , just the top - level ' obj '
 * being passed in .
 * @ throws IOException if one occurs on the underlying output stream . */
public void writeImpl ( Object obj , boolean showType , boolean allowRef , boolean allowCustom ) throws IOException { } }

implementation:
if ( neverShowType ) { showType = false ; } if ( obj == null ) { out . write ( "null" ) ; return ; } if ( allowCustom && writeIfMatching ( obj , showType , out ) ) { return ; } if ( allowRef && writeOptionalReference ( obj ) ) { return ; } if ( obj . getClass ( ) . isArray ( ) ) { writeArray ( obj , showType ) ; } else if ( obj instanceof Collection ) { writeCollection ( ( Collection ) obj , showType ) ; } else if ( obj instanceof JsonObject ) { // symmetric support for writing Map of Maps representation back as equivalent JSON format .
JsonObject jObj = ( JsonObject ) obj ; if ( jObj . isArray ( ) ) { writeJsonObjectArray ( jObj , showType ) ; } else if ( jObj . isCollection ( ) ) { writeJsonObjectCollection ( jObj , showType ) ; } else if ( jObj . isMap ( ) ) { if ( ! writeJsonObjectMapWithStringKeys ( jObj , showType ) ) { writeJsonObjectMap ( jObj , showType ) ; } } else { writeJsonObjectObject ( jObj , showType ) ; } } else if ( obj instanceof Map ) { if ( ! writeMapWithStringKeys ( ( Map ) obj , showType ) ) { writeMap ( ( Map ) obj , showType ) ; } } else { writeObject ( obj , showType , false ) ; }


signature:
public class JsonWriter { /** * Write fields of an Object ( JsonObject ) */
private void writeJsonObjectObject ( JsonObject jObj , boolean showType ) throws IOException { } }

implementation: if ( neverShowType ) { showType = false ; } final Writer output = this . out ; boolean referenced = objsReferenced . containsKey ( jObj ) && jObj . hasId ( ) ; showType = showType && jObj . type != null ; Class type = null ; output . write ( '{' ) ; tabIn ( ) ; if ( referenced ) { writeId ( String . valueOf ( jObj . id ) ) ; } if ( showType ) { if ( referenced ) { output . write ( ',' ) ; newLine ( ) ; } output . write ( shortMetaKeys ? "\"@t\":\"" : "\"@type\":\"" ) ; output . write ( getSubstituteTypeName ( jObj . type ) ) ; output . write ( '"' ) ; try { type = MetaUtils . classForName ( jObj . type , getClassLoader ( ) ) ; } catch ( Exception ignored ) { type = null ; } } if ( jObj . isEmpty ( ) ) { tabOut ( ) ; output . write ( '}' ) ; return ; } if ( showType || referenced ) { output . write ( ',' ) ; newLine ( ) ; } Iterator < Map . Entry < String , Object > > i = jObj . entrySet ( ) . iterator ( ) ; boolean first = true ; while ( i . hasNext ( ) ) { Map . Entry < String , Object > entry = i . next ( ) ; if ( skipNullFields && entry . getValue ( ) == null ) { continue ; } if ( ! first ) { output . write ( ',' ) ; newLine ( ) ; } first = false ; final String fieldName = entry . getKey ( ) ; output . write ( '"' ) ; output . write ( fieldName ) ; output . write ( "\":" ) ; Object value = entry . getValue ( ) ; if ( value == null ) { output . write ( "null" ) ; } else if ( neverShowType && MetaUtils . isPrimitive ( value . getClass ( ) ) ) { writePrimitive ( value , false ) ; } else if ( value instanceof BigDecimal || value instanceof BigInteger ) { writeImpl ( value , ! doesValueTypeMatchFieldType ( type , fieldName , value ) ) ; } else if ( value instanceof Number || value instanceof Boolean ) { output . write ( value . toString ( ) ) ; } else if ( value instanceof String ) { writeJsonUtf8String ( ( String ) value , output ) ; } else if ( value instanceof Character ) { writeJsonUtf8String ( String . valueOf ( value ) , output ) ; } else { writeImpl ( value , ! doesValueTypeMatchFieldType ( type , fieldName , value ) ) ; } } tabOut ( ) ; output . write ( '}' ) ;


signature:
public class JsonWriter { /** * Ensure that all keys within the Map are String instances
 * @ param map Map to inspect that all keys are primitive . This allows the output JSON
 * to be optimized into { " key1 " : value1 , " key2 " : value2 } format if all the
 * keys of the Map are Strings . If not , then a Map is written as two
 * arrays , an @ keys array and an @ items array . This allows support for Maps
 * with non - String keys . */
public static boolean ensureJsonPrimitiveKeys ( Map map ) { } }

implementation: for ( Object o : map . keySet ( ) ) { if ( ! ( o instanceof String ) ) { return false ; } } return true ;


signature:
public class JsonWriter { /** * Write an element that is contained in some type of Collection or Map .
 * @ param o Collection element to output in JSON format .
 * @ throws IOException if an error occurs writing to the output stream . */
private void writeCollectionElement ( Object o ) throws IOException { } }

implementation:
if ( o == null ) { out . write ( "null" ) ; } else if ( o instanceof Boolean || o instanceof Double ) { writePrimitive ( o , false ) ; } else if ( o instanceof Long ) { writePrimitive ( o , writeLongsAsStrings ) ; } else if ( o instanceof String ) { // Never do an @ ref to a String ( they are treated as logical primitives and intern ' ed on read )
writeJsonUtf8String ( ( String ) o , out ) ; } else if ( neverShowType && MetaUtils . isPrimitive ( o . getClass ( ) ) ) { // If neverShowType , then force primitives ( and primitive wrappers )
// to be output with toString ( ) - prevents { " value " : 6 } for example
writePrimitive ( o , false ) ; } else { writeImpl ( o , true ) ; }


signature:
public class JsonWriter { /** * Write out special characters " \ b , \ f , \ t , \ n , \ r " , as such , backslash as \ \
 * quote as \ " and values less than an ASCII space ( 20hex ) as " \ \ u00xx " format ,
 * characters in the range of ASCII space to a ' ~ ' as ASCII , and anything higher in UTF - 8.
 * @ param s String to be written in UTF - 8 format on the output stream .
 * @ param output Writer to which the UTF - 8 string will be written to
 * @ throws IOException if an error occurs writing to the output stream . */
public static void writeJsonUtf8String ( String s , final Writer output ) throws IOException { } }

implementation:
output . write ( '\"' ) ; final int len = s . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; if ( c < ' ' ) { // Anything less than ASCII space , write either in \ \ u00xx form , or the special \ t , \ n , etc . form
switch ( c ) { case '\b' : output . write ( "\\b" ) ; break ; case '\f' : output . write ( "\\f" ) ; break ; case '\n' : output . write ( "\\n" ) ; break ; case '\r' : output . write ( "\\r" ) ; break ; case '\t' : output . write ( "\\t" ) ; break ; default : output . write ( String . format ( "\\u%04X" , ( int ) c ) ) ; break ; } } else if ( c == '\\' || c == '"' ) { output . write ( '\\' ) ; output . write ( c ) ; } else { // Anything else - write in UTF - 8 form ( multi - byte encoded ) ( OutputStreamWriter is UTF - 8)
output . write ( c ) ; } } output . write ( '\"' ) ;


signature:
public class WorldbankImportServiceImpl { /** * Creates the map from list .
 * @ param all
 * the all
 * @ return the map */
private static Map < String , String > createMapFromList ( final List < String > all ) { } }

implementation: final Map < String , String > map = new ConcurrentHashMap < > ( ) ; for ( final String documentElement : all ) { if ( documentElement != null ) { map . put ( documentElement , documentElement ) ; } } return map ;


signature:
public class IndicatorElement { /** * Gets the source .
 * @ return the source */
@ Embedded @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "value" , column = @ Column ( name = "SOURCE_VALUE" ) ) , @ AttributeOverride ( name = "id" , column = @ Column ( name = "SOURCE_ID" ) ) } ) public Source getSource ( ) { return source ;


signature:
public class IndicatorElement { /** * Gets the topics .
 * @ return the topics */
@ ManyToOne ( targetEntity = Topics . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "TOPICS_INDICATOR_ELEMENT_HJID" ) public Topics getTopics ( ) { return topics ;


signature:
public class IndicatorElement { /** * Gets the hjid .
 * @ return the hjid */
@ Id @ Column ( name = "HJID" ) @ GeneratedValue ( strategy = GenerationType . AUTO ) public Long getHjid ( ) { } }

implementation: return hjid ;


signature:
public class DocumentDetailContainer { /** * Gets the document detail list .
 * @ return the document detail list */
@ OneToMany ( targetEntity = DocumentDetailData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DOCUMENT_DETAIL_LIST_DOCUMEN_0" ) public List < DocumentDetailData > getDocumentDetailList ( ) { return this . documentDetailList ;


signature:
public class ChartOptionsImpl { /** * Creates the axes XY date float .
 * @ return the axes */
private static Axes createAxesXYDateFloat ( ) { } }

implementation: return new Axes ( ) . addAxis ( new XYaxis ( ) . setRenderer ( AxisRenderers . DATE ) . setTickOptions ( new AxisTickRenderer ( ) . setFormatString ( YEAR_MONTH_DAY_FORMAT ) . setFontFamily ( FONT_FAMILY ) . setTextColor ( TEXT_COLOR ) . setFontSize ( FONT_SIZE ) ) . setNumberTicks ( NUMBER_TICKS_DATE ) ) . addAxis ( new XYaxis ( XYaxes . Y ) . setRenderer ( AxisRenderers . LINEAR ) . setTickOptions ( new AxisTickRenderer ( ) . setFormatString ( FLOAT_FORMAT ) . setFontFamily ( FONT_FAMILY ) . setTextColor ( TEXT_COLOR ) . setFontSize ( FONT_SIZE ) ) . setNumberTicks ( NUMBER_TICKS ) ) ;


signature:
public class ChartOptionsImpl { /** * Creates the default grid .
 * @ return the grid */
private static Grid createDefaultGrid ( ) { } }

implementation: final Grid grid = new Grid ( ) ; grid . setBackground ( BACKGROUND_COLOR ) ; grid . setGridLineColor ( GRIDLINE_COLOR ) ; grid . setBorderColor ( BORDER_COLOR ) ; return grid ;


signature:
public class ChartOptionsImpl { /** * Created legend enhanced inside north west .
 * @ return the legend */
private static Legend createdLegendEnhancedInsideNorthWest ( ) { } }

implementation: return setLegendStyling ( new Legend ( ) . setShow ( true ) . setRendererOptions ( new EnhancedLegendRenderer ( ) . setSeriesToggle ( SeriesToggles . NORMAL ) . setSeriesToggleReplot ( true ) . setNumberColumns ( LEGEND_COLUMNS ) . setNumberRows ( LEGEND_ROWS ) ) . setPlacement ( LegendPlacements . INSIDE_GRID ) . setLocation ( LegendLocations . NORTH_WEST ) ) ;


signature:
public class ChartOptionsImpl { /** * Created legend enhanced inside west .
 * @ return the legend */
private static Legend createdLegendEnhancedInsideWest ( ) { } }

implementation: return setLegendStyling ( new Legend ( ) . setShow ( true ) . setPlacement ( LegendPlacements . INSIDE_GRID ) . setLocation ( LegendLocations . WEST ) . setRenderer ( LegendRenderers . ENHANCED ) . setRendererOptions ( new EnhancedLegendRenderer ( ) . setSeriesToggle ( SeriesToggles . NORMAL ) . setSeriesToggleReplot ( true ) . setNumberColumns ( LEGEND_COLUMNS ) . setNumberRows ( LEGEND_ROWS ) ) ) ;


signature:
public class ChartOptionsImpl { /** * Creates the legend outside .
 * @ return the legend */
private static Legend createLegendOutside ( ) { } }

implementation: return setLegendStyling ( new Legend ( ) . setShow ( true ) . setRendererOptions ( new EnhancedLegendRenderer ( ) . setSeriesToggle ( SeriesToggles . NORMAL ) . setSeriesToggleReplot ( true ) . setNumberColumns ( LEGEND_COLUMNS ) . setNumberRows ( LEGEND_ROWS ) ) . setPlacement ( LegendPlacements . OUTSIDE_GRID ) ) ;


signature:
public class ChartOptionsImpl { /** * Creates the legend outside one column .
 * @ return the legend */
private static Legend createLegendOutsideOneColumn ( ) { } }

implementation: return setLegendStyling ( new Legend ( ) . setShow ( true ) . setRendererOptions ( new EnhancedLegendRenderer ( ) . setSeriesToggle ( SeriesToggles . NORMAL ) . setSeriesToggleReplot ( true ) . setNumberColumns ( ONE_COLUMN_NUMBER_OF_COLUMNS ) . setNumberRows ( ONE_COLUMN_NUMBER_OF_ROWS ) ) . setPlacement ( LegendPlacements . OUTSIDE_GRID ) ) ;


signature:
public class ChartOptionsImpl { /** * Creates the legend outside .
 * @ return the legend */
private static Legend createLegendInsideOneRow ( ) { } }

implementation: return setLegendStyling ( new Legend ( ) . setShow ( true ) . setRendererOptions ( new EnhancedLegendRenderer ( ) . setSeriesToggle ( SeriesToggles . NORMAL ) . setSeriesToggleReplot ( true ) . setNumberColumns ( ONE_ROW_NUMBER_OF_COLUMNS ) . setNumberRows ( ONE_ROW_NUMBER_OF_ROWS ) ) . setPlacement ( LegendPlacements . INSIDE_GRID ) ) ;


signature:
public class ChartOptionsImpl { /** * Sets the legend styling .
 * @ param legend
 * the legend
 * @ return the legend */
private static Legend setLegendStyling ( final Legend legend ) { } }

implementation: legend . setBackground ( BACKGROUND_COLOR ) . setFontFamily ( FONT_FAMILY ) . setTextColor ( TEXT_COLOR ) . setFontSize ( LEGEND_FONT_SIZE ) ; return legend ;


signature:
public class ChartOptionsImpl { /** * Creates the high lighter .
 * @ return the highlighter */
private static Highlighter createHighLighter ( ) { } }

implementation: return new Highlighter ( ) . setShow ( true ) . setShowTooltip ( true ) . setTooltipAlwaysVisible ( true ) . setKeepTooltipInsideChart ( true ) ;


signature:
public class ChartOptionsImpl { /** * Creates the high lighter north .
 * @ return the highlighter */
private static Highlighter createHighLighterNorth ( ) { } }

implementation: return new Highlighter ( ) . setShow ( true ) . setShowTooltip ( true ) . setTooltipAlwaysVisible ( true ) . setKeepTooltipInsideChart ( true ) . setTooltipLocation ( TooltipLocations . NORTH ) . setTooltipAxes ( TooltipAxes . XY_BAR ) . setShowMarker ( true ) . setBringSeriesToFront ( true ) ;


signature:
public class ChartOptionsImpl { /** * Creates the series default pie chart .
 * @ return the series defaults */
private static SeriesDefaults createSeriesDefaultPieChart ( ) { } }

implementation: return new SeriesDefaults ( ) . setRenderer ( SeriesRenderers . PIE ) . setRendererOptions ( new PieRenderer ( ) . setShowDataLabels ( true ) ) . setShadow ( true ) ;


signature:
public class ChartOptionsImpl { /** * Creates the donout series default .
 * @ return the series defaults */
private static SeriesDefaults createDonoutSeriesDefault ( ) { } }

implementation: return new SeriesDefaults ( ) . setRenderer ( SeriesRenderers . DONUT ) . setRendererOptions ( new DonutRenderer ( ) . setSliceMargin ( SLICE_MARGIN ) . setStartAngle ( START_ANGLE ) . setShowDataLabels ( true ) . setDataLabels ( DataLabels . VALUE ) ) ;


signature:
public class DocumentAttachmentContainer { /** * Gets the document attachment list .
 * @ return the document attachment list */
@ OneToMany ( targetEntity = DocumentAttachment . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DOCUMENT_ATTACHMENT_LIST_DOC_0" ) public List < DocumentAttachment > getDocumentAttachmentList ( ) { return this . documentAttachmentList ;


signature:
public class CommitteeRankingMenuItemFactoryImpl { /** * Creates the committeee ranking menu bar .
 * @ param menuBar
 * the menu bar */
@ Override public void createCommitteeeRankingMenuBar ( final MenuBar menuBar ) { } }

implementation: initApplicationMenuBar ( menuBar ) ; applicationMenuItemFactory . addRankingMenu ( menuBar ) ; createCommitteeRankingTopics ( menuBar . addItem ( COMMITTEE_RANKING_TEXT , null , null ) ) ;


signature:
public class CommitteeRankingMenuItemFactoryImpl { /** * Creates the committee ranking topics .
 * @ param committeeMenuItem
 * the committee menu item */
@ Override public void createCommitteeRankingTopics ( final MenuItem committeeMenuItem ) { } }

implementation: committeeMenuItem . addItem ( OVERVIEW_TEXT , VaadinIcons . GROUP , COMMAND_OVERVIEW ) ; final MenuItem listByTopic = committeeMenuItem . addItem ( RANKING_LIST_BY_TOPIC_TEXT , VaadinIcons . GROUP , null ) ; final MenuItem listItem = listByTopic . addItem ( POLITICAL_WORK_SUMMARY_TEXT , VaadinIcons . GROUP , COMMAND_DATAGRID ) ; listItem . setDescription ( CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_POLTICIAL_DAYS ) ; final MenuItem chartByTopic = committeeMenuItem . addItem ( CHART_BY_TOPIC_TEXT , VaadinIcons . GROUP , null ) ; chartByTopic . addItem ( CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT , VaadinIcons . GROUP , COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT ) ; chartByTopic . addItem ( CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS , VaadinIcons . GROUP , COMMAND_COMMITTEES_BY_PARTY ) ; chartByTopic . addItem ( CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES , VaadinIcons . GROUP , COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED ) ; chartByTopic . addItem ( ALL_COMMITTEES_TOTAL_MEMBERS , VaadinIcons . GROUP , COMMAND_ALL_COMMITTEES_BY_HEADCOUNT ) ; committeeMenuItem . addItem ( PAGE_VISIT_HISTORY_TEXT , VaadinIcons . GROUP , COMMAND_PAGEVISIT_HISTORY ) ;


signature:
public class CommitteeRankingMenuItemFactoryImpl { /** * Creates the overview page .
 * @ param panelContent
 * the panel content */
@ Override public void createOverviewPage ( final VerticalLayout panelContent ) { } }

implementation: final ResponsiveRow grid = RowUtil . createGridLayout ( panelContent ) ; createButtonLink ( grid , POLITICAL_WORK_SUMMARY_TEXT , VaadinIcons . GROUP , COMMAND_DATAGRID , "Scoreboard over current member size, political days served and total assignments" ) ; createButtonLink ( grid , CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT , VaadinIcons . GROUP , COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT , "Chart over current committees and member size" ) ; createButtonLink ( grid , CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS , VaadinIcons . GROUP , COMMAND_COMMITTEES_BY_PARTY , "Chart over current parties active in committees and member size" ) ; createButtonLink ( grid , CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES , VaadinIcons . GROUP , COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED , "Chart over current parties active in committees days served" ) ; createButtonLink ( grid , ALL_COMMITTEES_TOTAL_MEMBERS , VaadinIcons . GROUP , COMMAND_ALL_COMMITTEES_BY_HEADCOUNT , "Chart over all committees and member size" ) ; createButtonLink ( grid , PAGE_VISIT_HISTORY_TEXT , VaadinIcons . GROUP , COMMAND_PAGEVISIT_HISTORY , "View history of page visit for this page." ) ;


signature:
public class PoliticianOverviewPageModContentFactoryImpl { /** * Creates the overview content .
 * @ param panelContent the panel content
 * @ param personData the person data
 * @ param viewRiksdagenPolitician the view riksdagen politician
 * @ param pageId the page id */
private void createOverviewContent ( final VerticalLayout panelContent , final PersonData personData , final ViewRiksdagenPolitician viewRiksdagenPolitician , final String pageId ) { } }

implementation: LabelFactory . createHeader2Label ( panelContent , OVERVIEW ) ; final Link createPoliticianPageLink = getPageLinkFactory ( ) . createPoliticianPageLink ( personData ) ; panelContent . addComponent ( createPoliticianPageLink ) ; final Image image = new Image ( "" , new ExternalResource ( personData . getImageUrl192 ( ) . replace ( "http://" , "https://" ) ) ) ; final HorizontalLayout horizontalLayout = new HorizontalLayout ( ) ; horizontalLayout . setSizeFull ( ) ; panelContent . addComponent ( horizontalLayout ) ; horizontalLayout . addComponent ( image ) ; getFormFactory ( ) . addFormPanelTextFields ( horizontalLayout , viewRiksdagenPolitician , ViewRiksdagenPolitician . class , AS_LIST ) ; final VerticalLayout overviewLayout = new VerticalLayout ( ) ; overviewLayout . setSizeFull ( ) ; panelContent . addComponent ( overviewLayout ) ; panelContent . setExpandRatio ( overviewLayout , ContentRatio . LARGE_FORM ) ; getPoliticianMenuItemFactory ( ) . createOverviewPage ( overviewLayout , pageId ) ; panelContent . setExpandRatio ( createPoliticianPageLink , ContentRatio . SMALL ) ; panelContent . setExpandRatio ( horizontalLayout , ContentRatio . GRID ) ;


signature:
public class ObjectFactory { /** * Creates a new Object object .
 * @ param value the value
 * @ return the JAXB element < document container element > */
@ XmlElementDecl ( namespace = "http://dokumentlista.riksdagen.external.model.cia.hack23.com/impl" , name = "dokumentlista" ) public JAXBElement < DocumentContainerElement > createDokumentlista ( final DocumentContainerElement value ) { } }

implementation: return new JAXBElement < > ( _Dokumentlista_QNAME , DocumentContainerElement . class , null , value ) ;


signature:
public class SwedenMunicipalityData { /** * Gets the kommunvalkrets .
 * @ return the kommunvalkrets */
@ OneToMany ( targetEntity = SwedenMunicipalityElectionRegionData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "KOMMUNVALKRETS_SWEDEN_MUNICI_0" ) public List < SwedenMunicipalityElectionRegionData > getKommunvalkrets ( ) { return this . kommunvalkrets ;


signature:
public class DataElement { /** * Gets the data .
 * @ return the data */
@ OneToMany ( targetEntity = WorldBankData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DATA__DATA_ELEMENT_HJID" ) public List < WorldBankData > getData ( ) { return this . data ;


signature:
public class BootstrapDefaultConfig { /** * Configure authentication .
 * @ param role
 * the role */
private static void configureAuthentication ( final String role ) { } }

implementation: final Collection < GrantedAuthority > authorities = AuthorityUtils . createAuthorityList ( role ) ; final Authentication authentication = new UsernamePasswordAuthenticationToken ( "service.impl.BootstrapDefaultConfig" , "n/a" , authorities ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( authentication ) ;


signature:
public class ComplianceCheckResponse { /** * Sets the list .
 * @ param list
 * the new list */
public void setList ( final List < ComplianceCheck > list ) { } }

implementation: this . list = Collections . unmodifiableList ( ListUtils . emptyIfNull ( list ) ) ;


signature:
public class ComplianceCheckResponse { /** * Sets the status map .
 * @ param statusMap
 * the new status map */
public void setStatusMap ( final Map < Status , List < RuleViolation > > statusMap ) { } }

implementation: this . statusMap = Collections . unmodifiableMap ( MapUtils . emptyIfNull ( statusMap ) ) ;


signature:
public class ComplianceCheckResponse { /** * Sets the resource type map .
 * @ param resourceTypeMap
 * the new resource type map */
public void setResourceTypeMap ( final Map < ResourceType , List < RuleViolation > > resourceTypeMap ) { } }

implementation: this . resourceTypeMap = Collections . unmodifiableMap ( MapUtils . emptyIfNull ( resourceTypeMap ) ) ;


signature:
public class PartyCoalationChartDataManagerImpl { /** * Adds the data .
 * @ param map the map
 * @ param series the series
 * @ param dataSeries the data series */
private static void addData ( final Map < String , List < ViewRiksdagenPartyCoalationAgainstAnnualSummary > > map , final Series series , final DataSeries dataSeries ) { } }

implementation: final Set < Entry < String , List < ViewRiksdagenPartyCoalationAgainstAnnualSummary > > > entryMap = map . entrySet ( ) ; for ( final Entry < String , List < ViewRiksdagenPartyCoalationAgainstAnnualSummary > > entry : entryMap ) { if ( ! entry . getValue ( ) . isEmpty ( ) ) { series . addSeries ( new XYseries ( ) . setLabel ( entry . getKey ( ) ) ) ; dataSeries . newSeries ( ) ; for ( final ViewRiksdagenPartyCoalationAgainstAnnualSummary data : entry . getValue ( ) ) { dataSeries . add ( data . getEmbeddedId ( ) . getYear ( ) + "-01-01" , data . getTotal ( ) ) ; } } }


signature:
public class SwedenCountyData { /** * Gets the kommun .
 * @ return the kommun */
@ OneToMany ( targetEntity = SwedenMunicipalityData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "KOMMUN_SWEDEN_COUNTY_DATA_HJ_0" ) public List < SwedenMunicipalityData > getKommun ( ) { return this . kommun ;


signature:
public class PersonAssignmentElement { /** * Gets the uppdrag .
 * @ return the uppdrag */
@ OneToMany ( targetEntity = AssignmentElement . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "UPPDRAG_PERSON_ASSIGNMENT_EL_0" ) public List < AssignmentElement > getUppdrag ( ) { return this . uppdrag ;


signature:
public class DocumentProposalContainer { /** * Gets the proposal .
 * @ return the proposal */
@ ManyToOne ( targetEntity = DocumentProposalData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "PROPOSAL_DOCUMENT_PROPOSAL_C_0" ) public DocumentProposalData getProposal ( ) { return proposal ;


signature:
public class PageModeMenuCommand { /** * Gets the page path .
 * @ return the page path */
public String getPagePath ( ) { } }

implementation: if ( pageReference != null && ! pageReference . isEmpty ( ) ) { return page + PAGE_SEPARATOR + pageReference ; } else { return page ; }


signature:
public class ViewRiksdagenPartyCoalationAgainstAnnualSummary { /** * Gets the value of the embeddedId property .
 * @ return
 * possible object is
 * { @ link ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId } */
@ EmbeddedId @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "year" , column = @ Column ( name = "EMBEDDED_ID_YEAR" , precision = 10 , scale = 0 ) ) , @ AttributeOverride ( name = "groupAgainst" , column = @ Column ( name = "EMBEDDED_ID_GROUP_AGAINST" ) ) } ) public ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId getEmbeddedId ( ) { return embeddedId ;


signature:
public class AbstractPartyPageModContentFactoryImpl { /** * Page completed .
 * @ param parameters
 * the parameters
 * @ param panel
 * the panel
 * @ param pageId
 * the page id
 * @ param viewRiksdagenParty
 * the view riksdagen party */
protected final void pageCompleted ( final String parameters , final Component panel , final String pageId , final ViewRiksdagenParty viewRiksdagenParty ) { } }

implementation: panel . setCaption ( new StringBuilder ( ) . append ( NAME ) . append ( CAPTION_SEPARATOR ) . append ( PARTY ) . append ( viewRiksdagenParty . getPartyName ( ) ) . toString ( ) ) ; getPageActionEventHelper ( ) . createPageEvent ( ViewAction . VISIT_PARTY_VIEW , ApplicationEventGroup . USER , NAME , parameters , pageId ) ;


signature:
public class RiksdagenVoteDataWorkConsumerImpl { /** * Update ballot .
 * @ param ballotId
 * the ballot id */
private void updateBallot ( final String ballotId ) { } }

implementation: try { configureAuthentication ( ) ; updateService . updateVoteDataData ( riksdagenApi . getBallot ( ballotId ) ) ; } catch ( final DataFailureException e ) { LOGGER . warn ( "Eror loading riksdagen voteData:" + ballotId + " errorMessage:" , e ) ; } finally { clearAuthentication ( ) ; }


signature:
public class IndicatorsElement { /** * Gets the indicator .
 * @ return the indicator */
@ OneToMany ( targetEntity = IndicatorElement . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "INDICATOR__INDICATORS_ELEMEN_0" ) public List < IndicatorElement > getIndicator ( ) { return this . indicator ;


signature:
public class ObjectFactory { /** * Creates a new Object object .
 * @ param value the value
 * @ return the JAXB element < committee proposal component data > */
@ XmlElementDecl ( namespace = "http://utskottsforslag.riksdagen.external.model.cia.hack23.com/impl" , name = "utskottsforslag" ) public JAXBElement < CommitteeProposalComponentData > createUtskottsforslag ( final CommitteeProposalComponentData value ) { } }

implementation: return new JAXBElement < > ( _Utskottsforslag_QNAME , CommitteeProposalComponentData . class , null , value ) ;


signature:
public class PartyChartDataManagerImpl { /** * Gets the max size view riksdagen vote data ballot party summary daily .
 * @ return the max size view riksdagen vote data ballot party summary daily */
private List < ViewRiksdagenVoteDataBallotPartySummaryDaily > getMaxSizeViewRiksdagenVoteDataBallotPartySummaryDaily ( ) { } }

implementation: initPartyMap ( ) ; final Optional < Entry < String , List < ViewRiksdagenVoteDataBallotPartySummaryDaily > > > first = partyMap . entrySet ( ) . stream ( ) . sorted ( ( e1 , e2 ) -> Integer . compare ( e2 . getValue ( ) . size ( ) , e1 . getValue ( ) . size ( ) ) ) . findFirst ( ) ; if ( first . isPresent ( ) ) { return first . get ( ) . getValue ( ) ; } else { return new ArrayList < > ( ) ; }


signature:
public class PartyChartDataManagerImpl { /** * Inits the party map . */
private synchronized void initPartyMap ( ) { } }

implementation: if ( partyMap == null ) { final DataContainer < ViewRiksdagenVoteDataBallotPartySummaryDaily , RiksdagenVoteDataBallotPartyPeriodSummaryEmbeddedId > partyBallotSummaryDailyDataContainer = getApplicationManager ( ) . getDataContainer ( ViewRiksdagenVoteDataBallotPartySummaryDaily . class ) ; partyMap = partyBallotSummaryDailyDataContainer . getAll ( ) . parallelStream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . groupingBy ( t -> t . getEmbeddedId ( ) . getParty ( ) ) ) ; }


signature:
public class PartyChartDataManagerImpl { /** * Adds the party data .
 * @ param dataSeries the data series
 * @ param simpleDateFormat the simple date format
 * @ param list the list
 * @ param t the t */
private static void addPartyData ( final DataSeries dataSeries , final SimpleDateFormat simpleDateFormat , final List < ViewRiksdagenVoteDataBallotPartySummaryDaily > list , final Function < ViewRiksdagenVoteDataBallotPartySummaryDaily , Object > t ) { } }

implementation: dataSeries . newSeries ( ) ; for ( final ViewRiksdagenVoteDataBallotPartySummaryDaily viewRiksdagenVoteDataBallotPartySummaryDaily : list ) { if ( viewRiksdagenVoteDataBallotPartySummaryDaily != null ) { dataSeries . add ( simpleDateFormat . format ( viewRiksdagenVoteDataBallotPartySummaryDaily . getEmbeddedId ( ) . getVoteDate ( ) ) , t . apply ( viewRiksdagenVoteDataBallotPartySummaryDaily ) ) ; } }


signature:
public class PartyChartDataManagerImpl { /** * Creates the party ballot chart .
 * @ param dataValueCalculator
 * the data value calculator
 * @ return the d charts */
private void createPartyBallotChart ( final AbstractOrderedLayout content , final DataValueCalculator dataValueCalculator ) { } }

implementation: final Map < String , List < ViewRiksdagenVoteDataBallotPartySummaryDaily > > map = getPartyMap ( ) ; final DataSeries dataSeries = new DataSeries ( ) ; final SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( DD_MMM_YYYY , Locale . ENGLISH ) ; final Series series = new Series ( ) ; for ( final Entry < String , List < ViewRiksdagenVoteDataBallotPartySummaryDaily > > entry : map . entrySet ( ) ) { if ( ! "-" . equals ( entry . getKey ( ) ) ) { addBallotData ( dataValueCalculator , dataSeries , simpleDateFormat , series , entry ) ; } } addChart ( content , "Party ballot chart" , new DCharts ( ) . setDataSeries ( dataSeries ) . setOptions ( getChartOptions ( ) . createOptionsXYDateFloatLegendInsideOneColumn ( series ) ) . show ( ) , true ) ;


signature:
public class PartyChartDataManagerImpl { /** * Adds the ballot data .
 * @ param dataValueCalculator the data value calculator
 * @ param dataSeries the data series
 * @ param simpleDateFormat the simple date format
 * @ param series the series
 * @ param entry the entry */
private void addBallotData ( final DataValueCalculator dataValueCalculator , final DataSeries dataSeries , final SimpleDateFormat simpleDateFormat , final Series series , final Entry < String , List < ViewRiksdagenVoteDataBallotPartySummaryDaily > > entry ) { } }

implementation: series . addSeries ( new XYseries ( ) . setLabel ( getPartyName ( entry . getKey ( ) ) ) ) ; dataSeries . newSeries ( ) ; final List < ViewRiksdagenVoteDataBallotPartySummaryDaily > list = entry . getValue ( ) ; for ( final ViewRiksdagenVoteDataBallotPartySummaryDaily viewRiksdagenVoteDataBallotPartySummaryDaily : list ) { if ( viewRiksdagenVoteDataBallotPartySummaryDaily != null ) { dataSeries . add ( simpleDateFormat . format ( viewRiksdagenVoteDataBallotPartySummaryDaily . getEmbeddedId ( ) . getVoteDate ( ) ) , dataValueCalculator . getDataValue ( viewRiksdagenVoteDataBallotPartySummaryDaily ) ) ; } }


signature:
public class EsvGovernmentBodyOperationOutcomeReaderImpl { /** * Read csv content .
 * @ param is
 * the is
 * @ param specificFields
 * the specific fields
 * @ return the list
 * @ throws IOException
 * Signals that an I / O exception has occurred . */
private List < GovernmentBodyAnnualOutcomeSummary > readCsvContent ( final InputStream is , final String [ ] specificFields ) throws IOException { } }

implementation: final CSVParser parser = CSVParser . parse ( new InputStreamReader ( is , Charsets . UTF_8 ) , CSVFormat . EXCEL . withHeader ( ) . withDelimiter ( ';' ) ) ; final List < CSVRecord > records = parser . getRecords ( ) ; records . remove ( 0 ) ; final Map < Integer , Map < String , String > > orgMinistryMap = createOrgMinistryMap ( esvExcelReader . getDataPerMinistry ( null ) ) ; final List < GovernmentBodyAnnualOutcomeSummary > list = new ArrayList < > ( ) ; for ( final CSVRecord csvRecord : records ) { final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary = new GovernmentBodyAnnualOutcomeSummary ( csvRecord . get ( MYNDIGHET ) , csvRecord . get ( ORGANISATIONSNUMMER ) , orgMinistryMap . get ( Integer . valueOf ( csvRecord . get ( YEAR ) ) ) . get ( csvRecord . get ( ORGANISATIONSNUMMER ) . replaceAll ( "-" , "" ) ) , Integer . parseInt ( csvRecord . get ( YEAR ) ) ) ; for ( final String field : specificFields ) { governmentBodyAnnualOutcomeSummary . addDescriptionField ( field , csvRecord . get ( field ) ) ; } addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . JANUARY . getValue ( ) , csvRecord . get ( UTFALL_JANUARI ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . FEBRUARY . getValue ( ) , csvRecord . get ( UTFALL_FEBRUARI ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . MARCH . getValue ( ) , csvRecord . get ( UTFALL_MARS ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . APRIL . getValue ( ) , csvRecord . get ( UTFALL_APRIL ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . MAY . getValue ( ) , csvRecord . get ( UTFALL_MAJ ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . JUNE . getValue ( ) , csvRecord . get ( UTFALL_JUNI ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . JULY . getValue ( ) , csvRecord . get ( UTFALL_JULI ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . AUGUST . getValue ( ) , csvRecord . get ( UTFALL_AUGUSTI ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . SEPTEMBER . getValue ( ) , csvRecord . get ( UTFALL_SEPTEMBER ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . OCTOBER . getValue ( ) , csvRecord . get ( UTFALL_OKTOBER ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . NOVEMBER . getValue ( ) , csvRecord . get ( UTFALL_NOVEMBER ) ) ; addResultForMonth ( governmentBodyAnnualOutcomeSummary , Month . DECEMBER . getValue ( ) , csvRecord . get ( UTFALL_DECEMBER ) ) ; list . add ( governmentBodyAnnualOutcomeSummary ) ; } return list ;


signature:
public class EsvGovernmentBodyOperationOutcomeReaderImpl { /** * Creates the org ministry map .
 * @ param data the data
 * @ return the map */
private static Map < Integer , Map < String , String > > createOrgMinistryMap ( final Map < Integer , List < GovernmentBodyAnnualSummary > > data ) { } }

implementation: final Map < Integer , Map < String , String > > orgMinistryMap = new HashMap < > ( ) ; final Set < Entry < Integer , List < GovernmentBodyAnnualSummary > > > entrySet = data . entrySet ( ) ; for ( final Entry < Integer , List < GovernmentBodyAnnualSummary > > entry : entrySet ) { orgMinistryMap . put ( entry . getKey ( ) , entry . getValue ( ) . stream ( ) . collect ( Collectors . groupingBy ( t -> t . getOrgNumber ( ) . replaceAll ( "-" , "" ) , Collectors . collectingAndThen ( Collectors . toList ( ) , values -> values . get ( 0 ) . getMinistry ( ) ) ) ) ) ; } return orgMinistryMap ;


signature:
public class EsvGovernmentBodyOperationOutcomeReaderImpl { /** * Adds the result for month .
 * @ param governmentBodyAnnualOutcomeSummary
 * the government body annual outcome summary
 * @ param month
 * the month
 * @ param value
 * the value */
private static void addResultForMonth ( final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary , final int month , final String value ) { } }

implementation: if ( value != null && value . length ( ) > 0 ) { governmentBodyAnnualOutcomeSummary . addData ( month , Double . valueOf ( value . replaceAll ( "," , "." ) ) ) ; }


signature:
public class FormFactoryImpl { /** * Creates the field .
 * @ param property the property
 * @ return the abstract field */
private static AbstractField < ? > createField ( final String property ) { } }

implementation: if ( StringUtils . containsIgnoreCase ( property , HIDDEN_FIELD_NAME ) ) { return new PasswordField ( ) ; } else { return new TextField ( ) ; }


signature:
public class FormFactoryImpl { /** * Creates the display property converters .
 * @ param < T > the generic type
 * @ param displayProperties the display properties
 * @ param formContent the form content
 * @ param binder the binder
 * @ param propertyDescriptors the property descriptors */
private static < T extends Serializable > void createDisplayPropertyConverters ( final List < String > displayProperties , final ComponentContainer formContent , final Binder < T > binder , final PropertyDescriptor [ ] propertyDescriptors ) { } }

implementation: for ( final String property : displayProperties ) { final Class < ? > typeOfProperty = getTypeOfProperty ( propertyDescriptors , property ) ; if ( typeOfProperty != null ) { final AbstractField < ? > field = new TextField ( ) ; field . setReadOnly ( true ) ; field . setCaption ( property ) ; field . setWidth ( ContentSize . FULL_SIZE ) ; formContent . addComponent ( field ) ; final Converter converter = getConverterForType ( typeOfProperty ) ; if ( converter != null ) { binder . forField ( field ) . withConverter ( converter ) . bind ( property ) ; } else { binder . forField ( field ) . bind ( property ) ; } } }


signature:
public class FormFactoryImpl { /** * Gets the converter for type .
 * @ param typeOfProperty
 * the type of property
 * @ return the converter for type */
private static Converter getConverterForType ( final Class < ? > typeOfProperty ) { } }

implementation: Converter converter ; if ( Date . class . equals ( typeOfProperty ) ) { converter = new StringToDateConverter ( ) ; } else if ( Integer . class . equals ( typeOfProperty ) || "int" . equalsIgnoreCase ( typeOfProperty . getName ( ) ) ) { converter = new StringToIntegerConverter ( "Input value should be an integer" ) ; } else if ( Long . class . equals ( typeOfProperty ) || "long" . equalsIgnoreCase ( typeOfProperty . getName ( ) ) ) { converter = new StringToLongConverter ( "Input value should be an long" ) ; } else if ( BigInteger . class . equals ( typeOfProperty ) ) { converter = new StringToBigIntegerConverter ( "Input value should be an biginteger" ) ; } else if ( BigDecimal . class . equals ( typeOfProperty ) ) { converter = new StringToBigDecimalConverter ( "Input value should be an bigdecimal" ) ; } else if ( Boolean . class . equals ( typeOfProperty ) || "boolean" . equalsIgnoreCase ( typeOfProperty . getName ( ) ) ) { converter = new StringToBooleanConverter ( "Input value should be an boolean" ) ; } else if ( typeOfProperty . isEnum ( ) ) { converter = new StringToEnumConverter ( ) ; } else { converter = null ; } return converter ;


signature:
public class FormFactoryImpl { /** * Gets the type of property .
 * @ param propertyDescriptors
 * the property descriptors
 * @ param property
 * the property
 * @ return the type of property */
private static Class < ? > getTypeOfProperty ( final PropertyDescriptor [ ] propertyDescriptors , final String property ) { } }

implementation: for ( final PropertyDescriptor propertyDescriptor : propertyDescriptors ) { if ( propertyDescriptor . getName ( ) . equalsIgnoreCase ( property ) ) { return propertyDescriptor . getPropertyType ( ) ; } } return null ;


signature:
public class DocumentActivityContainer { /** * Gets the document activities .
 * @ return the document activities */
@ OneToMany ( targetEntity = DocumentActivityData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DOCUMENT_ACTIVITIES_DOCUMENT_0" ) public List < DocumentActivityData > getDocumentActivities ( ) { return this . documentActivities ;


signature:
public class AbstractCommonBusinessServiceImpl { /** * Gets the user account from security context .
 * @ return the user account from security context */
protected final UserAccount getUserAccountFromSecurityContext ( ) { } }

implementation: final SecurityContext context = SecurityContextHolder . getContext ( ) ; if ( context != null ) { final Authentication authentication = context . getAuthentication ( ) ; if ( authentication != null ) { return userDAO . findFirstByProperty ( UserAccount_ . userId , authentication . getPrincipal ( ) . toString ( ) ) ; } } return null ;


signature:
public class SwedenCountyDataContainer { /** * Gets the county regions .
 * @ return the county regions */
@ OneToMany ( targetEntity = SwedenCountyData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "COUNTY_REGIONS_SWEDEN_COUNTY_0" ) public List < SwedenCountyData > getCountyRegions ( ) { return this . countyRegions ;


signature:
public class ViewApplicationActionEventPageModeWeeklySummary { /** * Gets the value of the embeddedId property .
 * @ return
 * possible object is
 * { @ link ApplicationActionEventPageModePeriodSummaryEmbeddedId } */
@ EmbeddedId @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "createdDate" , column = @ Column ( name = "EMBEDDED_ID_CREATED_DATE" ) ) , @ AttributeOverride ( name = "page" , column = @ Column ( name = "EMBEDDED_ID_PAGE" ) ) , @ AttributeOverride ( name = "pageMode" , column = @ Column ( name = "EMBEDDED_ID_PAGE_MODE" ) ) } ) public ApplicationActionEventPageModePeriodSummaryEmbeddedId getEmbeddedId ( ) { return embeddedId ;


signature:
public class CommitteeProposalComponentData { /** * Gets the against proposal container .
 * @ return the against proposal container */
@ ManyToOne ( targetEntity = AgainstProposalContainer . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "AGAINST_PROPOSAL_CONTAINER_C_0" ) public AgainstProposalContainer getAgainstProposalContainer ( ) { return againstProposalContainer ;


signature:
public class CommitteeProposalComponentData { /** * Gets the document .
 * @ return the document */
@ ManyToOne ( targetEntity = CommitteeDocumentData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DOCUMENT_COMMITTEE_PROPOSAL__0" ) public CommitteeDocumentData getDocument ( ) { return document ;


signature:
public class CommitteeProposalComponentData { /** * Gets the committee proposal container .
 * @ return the committee proposal container */
@ ManyToOne ( targetEntity = CommitteeProposalContainer . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "COMMITTEE_PROPOSAL_CONTAINER_0" ) public CommitteeProposalContainer getCommitteeProposalContainer ( ) { return committeeProposalContainer ;


signature:
public class ApplicationSession { /** * Gets the value of the events property .
 * This accessor method returns a reference to the live list ,
 * not a snapshot . Therefore any modification you make to the
 * returned list will be present inside the JAXB object .
 * This is why there is not a < CODE > set < / CODE > method for the events property .
 * For example , to add a new item , do as follows :
 * < pre >
 * getEvents ( ) . add ( newItem ) ;
 * < / pre >
 * Objects of the following type ( s ) are allowed in the list
 * { @ link ApplicationActionEvent } */
@ OneToMany ( targetEntity = ApplicationActionEvent . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "EVENTS_APPLICATION_SESSION_H_0" ) public List < ApplicationActionEvent > getEvents ( ) { if ( events == null ) { events = new ArrayList < > ( ) ; } return this . events ;


signature:
public class AbstractPageModContentFactoryImpl { /** * Gets the page id .
 * @ param parameters
 * the parameters
 * @ return the page id */
protected final String getPageId ( final String parameters ) { } }

implementation: if ( parameters != null ) { String cleanedString = parameters ; if ( parameters . contains ( "[" ) ) { cleanedString = cleanedString . replace ( cleanedString . substring ( cleanedString . indexOf ( '[' ) , cleanedString . lastIndexOf ( ']' ) + 1 ) , "" ) ; } return cleanedString . substring ( cleanedString . lastIndexOf ( '/' ) + "/" . length ( ) , cleanedString . length ( ) ) ; } else { return "" ; }


signature:
public class AbstractPageModContentFactoryImpl { /** * Gets the page nr .
 * @ param parameters the parameters
 * @ return the page nr */
protected final int getPageNr ( final String parameters ) { } }

implementation: final String cleanedString = parameters ; String pageNrValue ; if ( cleanedString != null && cleanedString . contains ( "[" ) && cleanedString . contains ( "]" ) ) { pageNrValue = cleanedString . substring ( cleanedString . indexOf ( '[' ) + 1 , cleanedString . lastIndexOf ( ']' ) ) ; } else { pageNrValue = "" ; } int pageNr = 1 ; if ( pageNrValue . length ( ) > 0 && ! pageNrValue . contains ( "/" ) ) { pageNr = Integer . parseInt ( pageNrValue ) ; } return pageNr ;


signature:
public class AbstractPageModContentFactoryImpl { /** * Creates the panel content .
 * @ return the vertical layout */
protected final VerticalLayout createPanelContent ( ) { } }

implementation: final VerticalLayout panelContent = new VerticalLayout ( ) ; panelContent . setMargin ( true ) ; panelContent . setWidth ( 100 , Unit . PERCENTAGE ) ; panelContent . setHeight ( 100 , Unit . PERCENTAGE ) ; panelContent . setStyleName ( "Header" ) ; return panelContent ;


signature:
public class AbstractPageModContentFactoryImpl { /** * Creates the page visit history .
 * @ param pageName
 * the page name
 * @ param pageId
 * the page id
 * @ param panelContent
 * the panel content */
protected final void createPageVisitHistory ( final String pageName , final String pageId , final VerticalLayout panelContent ) { } }

implementation: final TabSheet tabsheet = new TabSheet ( ) ; tabsheet . setWidth ( 100 , Unit . PERCENTAGE ) ; tabsheet . setHeight ( 100 , Unit . PERCENTAGE ) ; panelContent . addComponent ( tabsheet ) ; panelContent . setExpandRatio ( tabsheet , ContentRatio . LARGE ) ; final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout ( ) ; tabContentPageItemRankHistory . setWidth ( 100 , Unit . PERCENTAGE ) ; tabContentPageItemRankHistory . setHeight ( 100 , Unit . PERCENTAGE ) ; final Tab tabPageItemRankHistory = tabsheet . addTab ( tabContentPageItemRankHistory ) ; tabPageItemRankHistory . setCaption ( CURRENT_PAGE_VISIT_HISTORY ) ; adminChartDataManager . createApplicationActionEventPageElementDailySummaryChart ( tabContentPageItemRankHistory , pageName , pageId ) ; final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout ( ) ; tabContentPageModeSummary . setWidth ( 100 , Unit . PERCENTAGE ) ; tabContentPageModeSummary . setHeight ( 100 , Unit . PERCENTAGE ) ; final Tab tabPageModeSummary = tabsheet . addTab ( tabContentPageModeSummary ) ; tabPageModeSummary . setCaption ( GENERAL_PAGE_MODE_PAGE_VISIT ) ; adminChartDataManager . createApplicationActionEventPageModeDailySummaryChart ( tabContentPageModeSummary , pageName ) ;


signature:
public class PoliticianDataManagerImpl { /** * Adds the politician indicator data .
 * @ param list
 * the list
 * @ param dataSeries
 * the data series
 * @ param simpleDateFormat
 * the simple date format */
private static void addPoliticianIndicatorData ( final List < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily > list , final DataSeries dataSeries , final SimpleDateFormat simpleDateFormat ) { } }

implementation: addPoliticanData ( list , dataSeries , simpleDateFormat , ViewRiksdagenVoteDataBallotPoliticianSummaryDaily :: getWonPercentage ) ; addPoliticanData ( list , dataSeries , simpleDateFormat , ViewRiksdagenVoteDataBallotPoliticianSummaryDaily :: getRebelPercentage ) ; addPoliticanData ( list , dataSeries , simpleDateFormat , ViewRiksdagenVoteDataBallotPoliticianSummaryDaily :: getPoliticianPercentageAbsent ) ; addPoliticanData ( list , dataSeries , simpleDateFormat , ViewRiksdagenVoteDataBallotPoliticianSummaryDaily :: getNumberBallots ) ;


signature:
public class PoliticianDataManagerImpl { /** * Adds the politican data .
 * @ param list the list
 * @ param dataSeries the data series
 * @ param simpleDateFormat the simple date format
 * @ param t the t */
private static void addPoliticanData ( final List < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily > list , final DataSeries dataSeries , final SimpleDateFormat simpleDateFormat , final Function < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily , Object > t ) { } }

implementation: dataSeries . newSeries ( ) ; for ( final ViewRiksdagenVoteDataBallotPoliticianSummaryDaily viewRiksdagenVoteDataBallotPoliticianSummaryDaily : list ) { if ( viewRiksdagenVoteDataBallotPoliticianSummaryDaily != null ) { dataSeries . add ( simpleDateFormat . format ( viewRiksdagenVoteDataBallotPoliticianSummaryDaily . getEmbeddedId ( ) . getVoteDate ( ) ) , t . apply ( viewRiksdagenVoteDataBallotPoliticianSummaryDaily ) ) ; } }


signature:
public class SetGoogleAuthenticatorCredentialResponse { /** * Sets the google auth scratch codes .
 * @ param googleAuthScratchCodes
 * the new google auth scratch codes */
public void setGoogleAuthScratchCodes ( final List < Integer > googleAuthScratchCodes ) { } }

implementation: if ( googleAuthScratchCodes != null ) { this . googleAuthScratchCodes = googleAuthScratchCodes . stream ( ) . collect ( Collectors . toList ( ) ) ; }


signature:
public class PersonContainerData { /** * Gets the person .
 * @ return the person */
@ ManyToOne ( targetEntity = PersonData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "PERSON_PERSON_CONTAINER_DATA_0" ) public PersonData getPerson ( ) { return person ;


signature:
public class LoadHelper { /** * Recursive initliaze .
 * @ param obj
 * the obj
 * @ param dejaVu
 * the deja vu
 * @ throws IllegalAccessException
 * the illegal access exception
 * @ throws InvocationTargetException
 * the invocation target exception
 * @ throws NoSuchMethodException
 * the no such method exception */
private static void recursiveInitialize ( final Object obj , final Set < Object > dejaVu ) { } }

implementation: dejaVu . add ( obj ) ; if ( ! Hibernate . isInitialized ( obj ) ) { Hibernate . initialize ( obj ) ; }


signature:
public class LoadHelper { /** * Recursive initliaze .
 * @ param < T >
 * the generic type
 * @ param obj
 * the obj
 * @ return the t */
public static < T > T recursiveInitialize ( final T obj ) { } }

implementation: if ( obj != null ) { final Set < Object > dejaVu = Collections . newSetFromMap ( new IdentityHashMap < Object , Boolean > ( ) ) ; recursiveInitialize ( obj , dejaVu ) ; } return obj ;


signature:
public class AbstractGhantChartManagerImpl { /** * Creates the role ghant .
 * @ param roleSummaryLayoutTabsheet the role summary layout tabsheet
 * @ param assignmentList the assignment list */
public final void createRoleGhant ( final AbstractOrderedLayout roleSummaryLayoutTabsheet , final Collection < T > assignmentList ) { } }

implementation: final Comparator < T > compare = getComparator ( ) ; final List < T > list = assignmentList . stream ( ) . filter ( ( final T x ) -> new DateTime ( getStepMapping ( ) . getFromDate ( x ) . getTime ( ) ) . getYear ( ) > FILTER_DATA_BEFORE_YEAR ) . collect ( Collectors . toList ( ) ) ; Collections . sort ( list , compare ) ; final Gantt createGantt = createGenericGantt ( list , getRoleMapping ( ) , getStepMapping ( ) ) ; roleSummaryLayoutTabsheet . addComponent ( createGantt ) ; roleSummaryLayoutTabsheet . setExpandRatio ( createGantt , ContentRatio . GRID ) ;


signature:
public class AbstractGhantChartManagerImpl { /** * Creates the generic gantt .
 * @ param assignmentList
 * the assignment list
 * @ param roleMapping
 * the role mapping
 * @ param stepMapping
 * the step mapping
 * @ return the gantt */
private Gantt createGenericGantt ( final List < T > assignmentList , final Function < T , String > roleMapping , final StepMapping < T > stepMapping ) { } }

implementation: final Map < String , List < T > > assignmentListMap = assignmentList . stream ( ) . collect ( Collectors . groupingBy ( roleMapping , TreeMap :: new , Collectors . toList ( ) ) ) ; final Gantt gantt = createGantt ( ) ; if ( ! assignmentList . isEmpty ( ) ) { gantt . setStartDate ( stepMapping . getFromDate ( assignmentList . get ( 0 ) ) ) ; gantt . setEndDate ( stripDatesAfterCurrentDate ( stepMapping . getToDate ( assignmentList . get ( assignmentList . size ( ) - 1 ) ) ) ) ; for ( final Entry < String , List < T > > entry : entriesSortedByValues ( assignmentListMap , stepMapping ) ) { final String stepName = entry . getKey ( ) ; final Step step = new Step ( stepName , CaptionMode . HTML ) ; step . setDescription ( stepName ) ; final List < T > assignments = entry . getValue ( ) ; Collections . sort ( assignments , getComparator ( ) ) ; addViewGenericRoleMemberToStep ( stepName , step , assignments , stepMapping ) ; gantt . addStep ( step ) ; } } return gantt ;


signature:
public class AbstractGhantChartManagerImpl { /** * Entries sorted by values .
 * @ param map
 * the map
 * @ param stepMapping
 * the step mapping
 * @ return the sorted set */
private SortedSet < Map . Entry < String , List < T > > > entriesSortedByValues ( final Map < String , List < T > > map , final StepMapping < T > stepMapping ) { } }

implementation: final Comparator < ? super Entry < String , List < T > > > compare = ( o1 , o2 ) -> { final Comparator < T > compare1 = ( o11 , o21 ) -> { final int compareDate = stepMapping . getFromDate ( o11 ) . compareTo ( stepMapping . getFromDate ( o21 ) ) ; if ( compareDate == 0 ) { final int compareType = stepMapping . getRoleCode ( o11 ) . compareTo ( stepMapping . getRoleCode ( o21 ) ) ; if ( compareType == 0 ) { return stepMapping . getOrg ( o11 ) . compareTo ( stepMapping . getOrg ( o21 ) ) ; } else { return compareType ; } } return compareDate ; } ; Collections . sort ( o1 . getValue ( ) , compare1 ) ; Collections . sort ( o2 . getValue ( ) , compare1 ) ; return compare1 . compare ( o1 . getValue ( ) . get ( 0 ) , o2 . getValue ( ) . get ( 0 ) ) ; } ; final SortedSet < Map . Entry < String , List < T > > > sortedEntries = new TreeSet < > ( compare ) ; sortedEntries . addAll ( map . entrySet ( ) ) ; return sortedEntries ;


signature:
public class AbstractGhantChartManagerImpl { /** * Adds the view generic role member to step .
 * @ param stepName
 * the step name
 * @ param step
 * the step
 * @ param assignments
 * the assignments
 * @ param stepMapping
 * the step mapping */
private void addViewGenericRoleMemberToStep ( final String stepName , final Step step , final List < T > assignments , final StepMapping < T > stepMapping ) { } }

implementation: for ( final T assignmentData : assignments ) { String subStepName = "" ; if ( stepMapping . getRoleCode ( assignmentData ) != null ) { subStepName = new StringBuilder ( ) . append ( stepMapping . getFirstName ( assignmentData ) ) . append ( CONTENT_SEPARATOR ) . append ( stepMapping . getLastName ( assignmentData ) ) . append ( PARTY_START_TAG ) . append ( stepMapping . getParty ( assignmentData ) ) . append ( PARTY_END_TAG ) . toString ( ) ; } final SubStep sameRoleSubStep = new SubStep ( stepName + '.' + subStepName , CaptionMode . HTML ) ; sameRoleSubStep . setDescription ( stepName + '.' + subStepName ) ; sameRoleSubStep . setBackgroundColor ( stepMapping . getBackgroundColor ( assignmentData ) ) ; sameRoleSubStep . setStartDate ( stepMapping . getFromDate ( assignmentData ) . getTime ( ) ) ; sameRoleSubStep . setEndDate ( stripDatesAfterCurrentDate ( stepMapping . getToDate ( assignmentData ) ) . getTime ( ) ) ; step . addSubStep ( sameRoleSubStep ) ; }


signature:
public class AbstractGhantChartManagerImpl { /** * Strip dates after current date .
 * @ param toDate
 * the to date
 * @ return the date */
private static final Date stripDatesAfterCurrentDate ( final Date toDate ) { } }

implementation: final DateTime currentTime = new DateTime ( ) ; if ( currentTime . isBefore ( toDate . getTime ( ) ) ) { return currentTime . plusDays ( 1 ) . toDate ( ) ; } else { return toDate ; }


signature:
public class AbstractGhantChartManagerImpl { /** * Creates the gantt .
 * @ return the gantt */
private static final Gantt createGantt ( ) { } }

implementation: final Gantt gantt = new Gantt ( ) ; gantt . setSizeFull ( ) ; gantt . setWidth ( 100 , Unit . PERCENTAGE ) ; gantt . setHeight ( 100 , Unit . PERCENTAGE ) ; gantt . setResizableSteps ( false ) ; gantt . setMovableSteps ( false ) ; gantt . setResolution ( Resolution . Week ) ; return gantt ;


signature:
public class AbstractPoliticianPageModContentFactoryImpl { /** * Convert to years string .
 * @ param totalDays
 * the total days
 * @ return the string */
protected final String convertToYearsString ( final long totalDays ) { } }

implementation: final long years = totalDays / DAYS_PER_STANDARD_YEAR ; final long days = totalDays - years * DAYS_PER_STANDARD_YEAR ; return years + " Years " + days + " days" ;


signature:
public class AbstractPoliticianPageModContentFactoryImpl { /** * Page completed .
 * @ param parameters
 * the parameters
 * @ param panel
 * the panel
 * @ param pageId
 * the page id
 * @ param viewRiksdagenPolitician
 * the view riksdagen politician */
protected final void pageCompleted ( final String parameters , final Component panel , final String pageId , final ViewRiksdagenPolitician viewRiksdagenPolitician ) { } }

implementation: getPageActionEventHelper ( ) . createPageEvent ( ViewAction . VISIT_POLITICIAN_VIEW , ApplicationEventGroup . USER , UserViews . POLITICIAN_VIEW_NAME , parameters , pageId ) ; panel . setCaption ( NAME + "::" + POLITICIAN + viewRiksdagenPolitician . getFirstName ( ) + ' ' + viewRiksdagenPolitician . getLastName ( ) + '(' + viewRiksdagenPolitician . getParty ( ) + ')' ) ;


signature:
public class MinistryRankingOverviewPageModContentFactoryImpl { /** * Creates the description .
 * @ return the text area */
private static TextArea createDescription ( ) { } }

implementation: final TextArea totalCommitteeRankinglistLabel = new TextArea ( MINISTRY_RANKING_BY_TOPIC , MINISTRY_RANKING_BY_TOPIC_DESCRIPTION ) ; totalCommitteeRankinglistLabel . setSizeFull ( ) ; totalCommitteeRankinglistLabel . setStyleName ( "Level2Header" ) ; return totalCommitteeRankinglistLabel ;


signature:
public class WorldBankData { /** * Gets the indicator .
 * @ return the indicator */
@ Embedded @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "value" , column = @ Column ( name = "INDICATOR_VALUE" ) ) , @ AttributeOverride ( name = "id" , column = @ Column ( name = "INDICATOR_ID" ) ) } ) public Indicator getIndicator ( ) { return indicator ;


signature:
public class WorldBankData { /** * Gets the country .
 * @ return the country */
@ Embedded @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "value" , column = @ Column ( name = "COUNTRY_VALUE" ) ) , @ AttributeOverride ( name = "id" , column = @ Column ( name = "COUNTRY_ID" ) ) } ) public Country getCountry ( ) { return country ;


signature:
public class SecretPGXADataSourceFactory { /** * Load secret XA data source .
 * @ param ref the ref
 * @ return the object */
private Object loadSecretXADataSource ( final Reference ref ) { } }

implementation: return loadBaseDataSource ( new SecretPGXADataSource ( ( ( SecretReference ) ref ) . getSecretCredentialsManager ( ) ) , ref ) ;


signature:
public class DataAgentApiImpl { /** * Send message .
 * @ param workOrder
 * the work order */
private void sendMessage ( final DataAgentWorkOrder workOrder ) { } }

implementation: switch ( workOrder . getTarget ( ) ) { case MODEL_EXTERNAL_RIKSDAGEN : for ( final RiksdagenDataSources datasource : RiksdagenDataSources . values ( ) ) { jmsSender . send ( riksdagenApiDestination , datasource ) ; } break ; case MODEL_EXTERNAL_WORLDBANK : for ( final WorldBankDataSources datasource : WorldBankDataSources . values ( ) ) { jmsSender . send ( worldBankApiDestination , datasource ) ; } break ; default : break ; }


signature:
public class DocumentPersonReferenceContainer { /** * Gets the document person reference list .
 * @ return the document person reference list */
@ OneToMany ( targetEntity = DocumentPersonReferenceData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "DOCUMENT_PERSON_REFERENCE_LI_1" ) public List < DocumentPersonReferenceData > getDocumentPersonReferenceList ( ) { return this . documentPersonReferenceList ;


signature:
public class DecisionDataFactoryImpl { /** * Adds the proposal committeee summary .
 * @ param processedIn
 * the processed in
 * @ param summary
 * the summary
 * @ param document
 * the document */
private static void addProposalCommitteeeSummary ( final String processedIn , final List < ProposalCommitteeeSummary > summary , final DocumentStatusContainer document ) { } }

implementation: if ( document . getDocumentProposal ( ) != null && document . getDocumentProposal ( ) . getProposal ( ) != null ) { final DocumentProposalData proposal = document . getDocumentProposal ( ) . getProposal ( ) ; if ( proposal . getProcessedIn ( ) != null && ! proposal . getProcessedIn ( ) . isEmpty ( ) && proposal . getCommittee ( ) != null && ! proposal . getCommittee ( ) . isEmpty ( ) && proposal . getProcessedIn ( ) . contains ( processedIn ) && proposal . getChamber ( ) . length ( ) <= "återförvisning till utskottet" . length ( ) && proposal . getChamber ( ) . length ( ) >= "avslag" . length ( ) ) { summary . add ( new ProposalCommitteeeSummary ( getCommittteeShortName ( proposal ) , getDocumentName ( document ) , cleanupDecision ( proposal . getChamber ( ) ) , document . getDocument ( ) . getHangarId ( ) ) ) ; } }


signature:
public class DecisionDataFactoryImpl { /** * Cleanup decision .
 * @ param chamber
 * the chamber
 * @ return the string */
private static String cleanupDecision ( final String chamber ) { } }

implementation: return chamber . toUpperCase ( Locale . ENGLISH ) . replace ( "(UTSKOTTET)" , "" ) . replace ( "UTKOTTET" , "UTSKOTTET" ) . replace ( "UTBSKOTTET" , "UTSKOTTET" ) . replace ( "UBTSKOTTET" , "UTSKOTTET" ) . replace ( "(" , "" ) . replace ( ")" , "" ) ;


signature:
public class DecisionDataFactoryImpl { /** * Gets the document name .
 * @ param document
 * the document
 * @ return the document name */
private static String getDocumentName ( final DocumentStatusContainer document ) { } }

implementation: if ( "prop" . equalsIgnoreCase ( document . getDocument ( ) . getDocumentType ( ) ) ) { return "Proposition" ; } else if ( document . getDocument ( ) . getSubType ( ) != null && document . getDocument ( ) . getSubType ( ) . length ( ) > "motion" . length ( ) ) { return document . getDocument ( ) . getSubType ( ) ; } else { return "Motion" ; }


signature:
public class DecisionDataFactoryImpl { /** * Gets the committtee short name .
 * @ param proposal
 * the proposal
 * @ return the committtee short name */
private static String getCommittteeShortName ( final DocumentProposalData proposal ) { } }

implementation: final String upperCase = proposal . getProcessedIn ( ) . replaceAll ( "\\d" , "" ) . replace ( "/:" , "" ) . toUpperCase ( Locale . ENGLISH ) ; if ( upperCase . contains ( "," ) ) { return upperCase . substring ( 0 , upperCase . indexOf ( ',' ) ) ; } else { return upperCase ; }


signature:
public class LoginBlockedAccessImpl { /** * Inits the settings . */
@ PostConstruct public void initSettings ( ) { } }

implementation: final Authentication authentication = new UsernamePasswordAuthenticationToken ( "system.init" , "n/a" , AuthorityUtils . createAuthorityList ( "ROLE_ADMIN" ) ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( authentication ) ; LOGGER . info ( LOGIN_BLOCK_SETTINGS , applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_USER , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_USER , DEFAULT_MAX_LOGIN_ATTEMPTS ) ) ; LOGGER . info ( LOGIN_BLOCK_SETTINGS , applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_SESSION , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_SESSION , DEFAULT_MAX_LOGIN_ATTEMPTS ) ) ; LOGGER . info ( LOGIN_BLOCK_SETTINGS , applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_IP , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_IP , DEFAULT_MAX_LOGIN_ATTEMPTS ) ) ; SecurityContextHolder . getContext ( ) . setAuthentication ( null ) ;


signature:
public class LoginBlockedAccessImpl { /** * Block by user failed login attempts .
 * @ param email
 * the email
 * @ param loginBlockResultImpl
 * the login block result impl */
private void blockByUserFailedLoginAttempts ( final String email , final LoginBlockResultImpl loginBlockResultImpl ) { } }

implementation: final UserAccount userExist = userDAO . findFirstByProperty ( UserAccount_ . email , email ) ; if ( userExist != null ) { final ApplicationConfiguration maxLoginAttemptsByUser = applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_USER , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_USER , DEFAULT_MAX_LOGIN_ATTEMPTS ) ; final List < ApplicationActionEvent > failedLoginsByThisUser = applicationActionEventDAO . findListByProperty ( new Object [ ] { email , ApplicationOperationType . AUTHENTICATION , ServiceResult . FAILURE . toString ( ) } , ApplicationActionEvent_ . elementId , ApplicationActionEvent_ . applicationOperation , ApplicationActionEvent_ . applicationMessage ) ; final Date oneHourAgo = new Date ( System . currentTimeMillis ( ) - ONE_HOUR ) ; final Map < Boolean , List < ApplicationActionEvent > > recentOldLoginAttemptsMap = failedLoginsByThisUser . stream ( ) . collect ( Collectors . groupingBy ( ( final ApplicationActionEvent x ) -> x . getCreatedDate ( ) . after ( oneHourAgo ) ) ) ; final List < ApplicationActionEvent > recentFailedLogins = recentOldLoginAttemptsMap . get ( Boolean . TRUE ) ; if ( recentFailedLogins != null && recentFailedLogins . size ( ) > NumberUtils . toInt ( maxLoginAttemptsByUser . getPropertyValue ( ) , DEFAULT_MAX_LOGINS ) ) { loginBlockResultImpl . setBlocked ( true ) ; loginBlockResultImpl . addMessages ( BLOCKED_BY_MORE_THAN_5_RECENT_LOGIN_ATTEMPTS_BY_THIS_USER ) ; } }


signature:
public class LoginBlockedAccessImpl { /** * Block by session or ip failed login attempts .
 * @ param sessionId
 * the session id
 * @ param loginBlockResultImpl
 * the login block result impl */
private void blockBySessionOrIpFailedLoginAttempts ( final String sessionId , final LoginBlockResultImpl loginBlockResultImpl ) { } }

implementation: final ApplicationSession applicationSession = applicationSessionDAO . findFirstByProperty ( ApplicationSession_ . sessionId , sessionId ) ; if ( applicationSession != null ) { final ApplicationConfiguration maxLoginAttemptsBySession = applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_SESSION , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_SESSION , DEFAULT_MAX_LOGIN_ATTEMPTS ) ; final List < ApplicationActionEvent > failedLoginsByThisSession = applicationActionEventDAO . findListByProperty ( new Object [ ] { sessionId , ApplicationOperationType . AUTHENTICATION , ServiceResult . FAILURE . toString ( ) } , ApplicationActionEvent_ . sessionId , ApplicationActionEvent_ . applicationOperation , ApplicationActionEvent_ . applicationMessage ) ; if ( failedLoginsByThisSession . size ( ) > NumberUtils . toInt ( maxLoginAttemptsBySession . getPropertyValue ( ) , DEFAULT_MAX_LOGINS ) ) { loginBlockResultImpl . setBlocked ( true ) ; loginBlockResultImpl . addMessages ( BLOCKED_BY_MORE_THAN_5_LOGIN_ATTEMPTS_BY_THIS_SESSION ) ; } if ( ! ( "0:0:0:0:0:0:0:1" . equals ( applicationSession . getIpInformation ( ) ) || "127.0.0.1" . equals ( applicationSession . getIpInformation ( ) ) ) ) { final List < ApplicationSession > applicationSessionsByIp = applicationSessionDAO . findListByProperty ( ApplicationSession_ . ipInformation , applicationSession . getIpInformation ( ) ) ; final List < String > sessionIdsWithIp = applicationSessionsByIp . stream ( ) . map ( ApplicationSession :: getSessionId ) . collect ( Collectors . toList ( ) ) ; final List < ApplicationActionEvent > applicationEventsWithIp = applicationActionEventDAO . findListByPropertyInList ( ApplicationActionEvent_ . sessionId , sessionIdsWithIp . toArray ( new Object [ sessionIdsWithIp . size ( ) ] ) ) ; final Date oneHourAgo = new Date ( System . currentTimeMillis ( ) - ONE_HOUR ) ; final Map < Boolean , List < ApplicationActionEvent > > recentOldLoginAttemptsMap = applicationEventsWithIp . stream ( ) . filter ( ( final ApplicationActionEvent x ) -> x . getApplicationOperation ( ) == ApplicationOperationType . AUTHENTICATION && x . getApplicationMessage ( ) . equals ( ServiceResult . FAILURE . toString ( ) ) ) . collect ( Collectors . groupingBy ( ( final ApplicationActionEvent x ) -> x . getCreatedDate ( ) . after ( oneHourAgo ) ) ) ; final List < ApplicationActionEvent > recentFailedLogins = recentOldLoginAttemptsMap . get ( Boolean . TRUE ) ; final ApplicationConfiguration maxLoginAttemptsByIp = applicationConfigurationService . checkValueOrLoadDefault ( MAX_FAILED_LOGIN_ATTEMPTS_RECENT_HOUR_PER_IP , BLOCKS_ANY_LOGIN_ATTEMPTS_AFTER_THIS_NUMBER_IS_REACHED , ConfigurationGroup . AUTHENTICATION , LoginBlockedAccessImpl . class . getSimpleName ( ) , LOGIN_BLOCKER , BLOCKS_LOGIN_ATTEMPTS , APPLICATION_AUTHENTICATION_ALLOW_MAX_RECENT_FAILED_LOGINS_BY_IP , DEFAULT_MAX_LOGIN_ATTEMPTS ) ; if ( recentFailedLogins != null && recentFailedLogins . size ( ) > NumberUtils . toInt ( maxLoginAttemptsByIp . getPropertyValue ( ) , DEFAULT_MAX_LOGINS_BY_IP ) ) { loginBlockResultImpl . setBlocked ( true ) ; loginBlockResultImpl . addMessages ( BLOCKED_BY_MORE_THAN_5_RECENT_LOGIN_ATTEMPTS_BY_THIS_IP ) ; } } }


signature:
public class RuleViolationPageItemRendererClickListener { /** * Navigate to page .
 * @ param violation
 * the violation */
private static void navigateToPage ( final RuleViolation violation ) { } }

implementation: if ( violation . getResourceType ( ) == ResourceType . PARTY ) { UI . getCurrent ( ) . getNavigator ( ) . navigateTo ( UserViews . PARTY_VIEW_NAME + PAGE_SEPARATOR + violation . getId ( ) ) ; } else { UI . getCurrent ( ) . getNavigator ( ) . navigateTo ( UserViews . POLITICIAN_VIEW_NAME + PAGE_SEPARATOR + violation . getId ( ) ) ; }


signature:
public class AbstractClickListener { /** * Gets the application manager .
 * @ return the application manager */
protected ApplicationManager getApplicationManager ( ) { } }

implementation: return WebApplicationContextUtils . getWebApplicationContext ( ( ( ServletRequestAttributes ) RequestContextHolder . currentRequestAttributes ( ) ) . getRequest ( ) . getSession ( true ) . getServletContext ( ) ) . getBean ( ApplicationManager . class ) ;


signature:
public class AbstractClickListener { /** * Show notification .
 * @ param caption the caption
 * @ param description the description
 * @ param type the type */
protected void showNotification ( final String caption , final String description , final Type type ) { } }

implementation: Notification . show ( caption , description , type ) ;


signature:
public class Topics { /** * Gets the topic .
 * @ return the topic */
@ OneToMany ( targetEntity = Topic . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "TOPIC_TOPICS_HJID" ) public List < Topic > getTopic ( ) { return this . topic ;


signature:
public class CountryMenuItemFactoryImpl { /** * Adds the sources and indicators to menu .
 * @ param countryIndicators
 * the country indicators
 * @ param sourceIndicatorMap
 * the source indicator map */
private static void addSourcesAndIndicatorsToMenu ( final MenuItem countryIndicators , final Map < String , List < ViewWorldbankIndicatorDataCountrySummary > > sourceIndicatorMap ) { } }

implementation: final Map < String , List < ViewWorldbankIndicatorDataCountrySummary > > sortedIndicatorMap = sourceIndicatorMap . entrySet ( ) . stream ( ) . sorted ( ( e1 , e2 ) -> e1 . getKey ( ) . compareTo ( e2 . getKey ( ) ) ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue , ( e1 , e2 ) -> e1 , LinkedHashMap :: new ) ) ; for ( final Entry < String , List < ViewWorldbankIndicatorDataCountrySummary > > entry : sortedIndicatorMap . entrySet ( ) ) { final MenuItem sourceItems = countryIndicators . addItem ( entry . getKey ( ) , null , null ) ; final List < ViewWorldbankIndicatorDataCountrySummary > sortedEntries = entry . getValue ( ) . stream ( ) . sorted ( ( e1 , e2 ) -> e1 . getIndicatorName ( ) . compareTo ( e2 . getIndicatorName ( ) ) ) . collect ( Collectors . toList ( ) ) ; for ( final ViewWorldbankIndicatorDataCountrySummary indciatorSummary : sortedEntries ) { final MenuItem addItem = sourceItems . addItem ( indciatorSummary . getIndicatorName ( ) , new PageModeMenuCommand ( UserViews . COUNTRY_RANKING_VIEW_NAME , PageMode . INDICATORS , indciatorSummary . getEmbeddedId ( ) . getIndicatorId ( ) ) ) ; addItem . setStyleName ( "RestrictedHeader" ) ; } }


signature:
public class CountryMenuItemFactoryImpl { /** * Gets the topic indicator map .
 * @ return the topic indicator map */
private Map < String , List < ViewWorldbankIndicatorDataCountrySummary > > getTopicIndicatorMap ( ) { } }

implementation: final DataContainer < ViewWorldbankIndicatorDataCountrySummary , WorldbankIndicatorDataCountrySummaryEmbeddedId > indicatorDataCountrSummaryDailyDataContainer = applicationManager . getDataContainer ( ViewWorldbankIndicatorDataCountrySummary . class ) ; return indicatorDataCountrSummaryDailyDataContainer . findListByEmbeddedProperty ( ViewWorldbankIndicatorDataCountrySummary . class , ViewWorldbankIndicatorDataCountrySummary_ . embeddedId , WorldbankIndicatorDataCountrySummaryEmbeddedId . class , WorldbankIndicatorDataCountrySummaryEmbeddedId_ . countryId , "SE" ) . parallelStream ( ) . filter ( t -> t != null && t . getSourceValue ( ) != null && t . getEndYear ( ) > DATA_POINTS_FOR_YEAR_ABOVE && t . getDataPoint ( ) > MINIMUM_NUMBER_DATA_POINTS ) . flatMap ( t -> Arrays . asList ( t . getTopics ( ) . split ( ";" ) ) . stream ( ) . map ( topic -> new AbstractMap . SimpleEntry < > ( topic , t ) ) ) . collect ( Collectors . groupingBy ( SimpleEntry :: getKey , Collectors . mapping ( SimpleEntry :: getValue , Collectors . toList ( ) ) ) ) ;


signature:
public class UserAccount { /** * Gets the value of the address property .
 * This accessor method returns a reference to the live list ,
 * not a snapshot . Therefore any modification you make to the
 * returned list will be present inside the JAXB object .
 * This is why there is not a < CODE > set < / CODE > method for the address property .
 * For example , to add a new item , do as follows :
 * < pre >
 * getAddress ( ) . add ( newItem ) ;
 * < / pre >
 * Objects of the following type ( s ) are allowed in the list
 * { @ link String } */
@ ElementCollection @ OrderColumn ( name = "HJINDEX" ) @ Column ( name = "HJVALUE" ) @ CollectionTable ( name = "USER_ACCOUNT_ADDRESS" , joinColumns = { } }

implementation: @ JoinColumn ( name = "HJID" ) } ) public List < String > getAddress ( ) { if ( address == null ) { address = new ArrayList < > ( ) ; } return this . address ;


signature:
public class ObjectFactory { /** * Creates a new Object object .
 * @ param value the value
 * @ return the JAXB element < topic element > */
@ XmlElementDecl ( namespace = "http://topic.worldbank.external.model.cia.hack23.com/impl" , name = "topic" ) public JAXBElement < TopicElement > createTopic ( final TopicElement value ) { } }

implementation: return new JAXBElement < > ( _Topic_QNAME , TopicElement . class , null , value ) ;


signature:
public class ViewRiksdagenCommitteeBallotDecisionPartySummary { /** * Gets the value of the embeddedId property .
 * @ return
 * possible object is
 * { @ link ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId } */
@ EmbeddedId @ AttributeOverrides ( { } }

implementation: @ AttributeOverride ( name = "id" , column = @ Column ( name = "EMBEDDED_ID_ID" ) ) , @ AttributeOverride ( name = "party" , column = @ Column ( name = "EMBEDDED_ID_PARTY" ) ) , @ AttributeOverride ( name = "hangarId" , column = @ Column ( name = "EMBEDDED_ID_HANGAR_ID" , precision = 20 , scale = 10 ) ) , @ AttributeOverride ( name = "issue" , column = @ Column ( name = "EMBEDDED_ID_ISSUE" ) ) , @ AttributeOverride ( name = "concern" , column = @ Column ( name = "EMBEDDED_ID_CONCERN" ) ) } ) public ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId getEmbeddedId ( ) { return embeddedId ;


signature:
public class AbstractGenericDAOImpl { /** * Adds the cache hints .
 * @ param typedQuery
 * the typed query
 * @ param comment
 * the comment */
protected final void addCacheHints ( final TypedQuery < ? > typedQuery , final String comment ) { } }

implementation: typedQuery . setHint ( "org.hibernate.cacheMode" , CacheMode . NORMAL ) ; typedQuery . setHint ( "org.hibernate.cacheable" , Boolean . TRUE ) ; typedQuery . setHint ( "org.hibernate.comment" , comment ) ;


signature:
public class AbstractGenericDAOImpl { /** * Gets the string id list .
 * @ param property
 * the property
 * @ return the string id list */
protected final List < String > getStringIdList ( final SingularAttribute < T , String > property ) { } }

implementation: final CriteriaQuery < String > criteria = getCriteriaBuilder ( ) . createQuery ( String . class ) ; final Root < T > root = criteria . from ( persistentClass ) ; criteria . select ( getCriteriaBuilder ( ) . construct ( String . class , root . get ( property ) ) ) ; return getEntityManager ( ) . createQuery ( criteria ) . getResultList ( ) ;


signature:
public class WorldbankIndicatorApiImpl { /** * Read using zip input stream .
 * @ param inputStream
 * the input stream
 * @ param specificFields
 * the specific fields
 * @ return the list
 * @ throws IOException
 * Signals that an I / O exception has occurred . */
private static List < String > readUsingZipInputStream ( final InputStream inputStream ) throws IOException { } }

implementation: final BufferedInputStream bis = new BufferedInputStream ( inputStream ) ; final ZipInputStream is = new ZipInputStream ( bis ) ; final List < String > list = new ArrayList < > ( ) ; try { ZipEntry entry ; while ( ( entry = is . getNextEntry ( ) ) != null ) { if ( entry . getName ( ) . startsWith ( "API_SWE_" ) ) { list . addAll ( readCsvContent ( is ) ) ; } } } finally { is . close ( ) ; } return list ;


signature:
public class WorldbankIndicatorApiImpl { /** * Read csv content .
 * @ param is
 * the is
 * @ return the list
 * @ throws IOException
 * Signals that an I / O exception has occurred . */
private static List < String > readCsvContent ( final InputStream is ) throws IOException { } }

implementation: final BufferedReader reader = new BufferedReader ( new InputStreamReader ( is , Charsets . UTF_8 ) ) ; for ( int i = 0 ; i < IGNORE_TOP_HEADERS_LINE ; i ++ ) { final String ignoreFirstLinesWithHeaders = reader . readLine ( ) ; } final CSVParser parser = CSVParser . parse ( reader , CSVFormat . EXCEL . withHeader ( ) . withDelimiter ( ',' ) ) ; final List < CSVRecord > records = parser . getRecords ( ) ; records . remove ( 0 ) ; final List < String > list = new ArrayList < > ( ) ; for ( final CSVRecord csvRecord : records ) { list . add ( csvRecord . get ( "Indicator Code" ) ) ; } return list ;


signature:
public class SankeyChart { /** * Adds the data row .
 * @ param from
 * the from
 * @ param to
 * the to
 * @ param weight
 * the weight */
public void addDataRow ( final String from , final String to , int weight ) { } }

implementation: getState ( ) . addDataRow ( from , to , weight ) ;


signature:
public class CommitteeRankingOverviewPageModContentFactoryImpl { /** * Creates the description .
 * @ return the text area */
private static TextArea createDescription ( ) { } }

implementation: final TextArea totalCommitteeRankinglistLabel = new TextArea ( COMMITTEE_RANKING_BY_TOPIC , COMMITTEE_RANKING_BY_TOPIC_DESCRIPTION ) ; totalCommitteeRankinglistLabel . setSizeFull ( ) ; totalCommitteeRankinglistLabel . setStyleName ( "Level2Header" ) ; return totalCommitteeRankinglistLabel ;


signature:
public class PagingUtilImpl { /** * Creates the paging controls .
 * @ param content the content
 * @ param name the name
 * @ param pageId the page id
 * @ param size the size
 * @ param pageNr the page nr
 * @ param resultPerPage the result per page */
@ Override public void createPagingControls ( final AbstractOrderedLayout content , final String name , final String pageId , final Long size , final int pageNr , final int resultPerPage ) { } }

implementation: final HorizontalLayout pagingControls = new HorizontalLayout ( ) ; pagingControls . setSpacing ( true ) ; pagingControls . setMargin ( true ) ; final long maxPages = ( size + resultPerPage - 1 ) / resultPerPage ; final StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( PAGE_HEADER ) . append ( pageNr ) . append ( PAGE_SEPARATOR ) . append ( maxPages ) . append ( PAGES_TOTAL_RESULTS ) . append ( size ) . append ( RESULTS_PER_PAGE ) . append ( resultPerPage ) . append ( SHOW ) ; final Label pageInfo = new Label ( stringBuilder . toString ( ) ) ; pagingControls . addComponent ( pageInfo ) ; pagingControls . setExpandRatio ( pageInfo , ContentRatio . SMALL ) ; if ( pageNr > PAGE_ONE ) { addPagingLink ( PREVIOUS_PAGE , name , pageId , pageNr - 1L , pagingControls ) ; } if ( maxPages > PAGE_ONE && pageNr < maxPages ) { addPagingLink ( NEXT_PAGE , name , pageId , pageNr + 1L , pagingControls ) ; } if ( maxPages > LIMIT_FOR_DISPLAYING_START_END_LINKS && pageNr > PAGE_ONE ) { addPagingLink ( FIRST_PAGE , name , pageId , 1 , pagingControls ) ; } if ( maxPages > LIMIT_FOR_DISPLAYING_START_END_LINKS && pageNr < maxPages ) { addPagingLink ( LAST_PAGE , name , pageId , maxPages , pagingControls ) ; } content . addComponent ( pagingControls ) ; content . setExpandRatio ( pagingControls , ContentRatio . SMALL2 ) ;


signature:
public class PagingUtilImpl { /** * Adds the paging link .
 * @ param label the label
 * @ param name the name
 * @ param pageId the page id
 * @ param maxPages the max pages
 * @ param pagingControls the paging controls */
private void addPagingLink ( final String label , final String name , final String pageId , final long maxPages , final HorizontalLayout pagingControls ) { } }

implementation: final Link previousPageLink = pageLinkFactory . createAdminPagingLink ( label , name , pageId , String . valueOf ( maxPages ) ) ; pagingControls . addComponent ( previousPageLink ) ; pagingControls . setExpandRatio ( previousPageLink , ContentRatio . SMALL ) ;


signature:
public class ObjectFactory { /** * Creates a new Object object .
 * @ param value the value
 * @ return the JAXB element < vote list container element > */
@ XmlElementDecl ( namespace = "http://voteringlista.riksdagen.external.model.cia.hack23.com/impl" , name = "voteringlista" ) public JAXBElement < VoteListContainerElement > createVoteringlista ( final VoteListContainerElement value ) { } }

implementation: return new JAXBElement < > ( _Voteringlista_QNAME , VoteListContainerElement . class , null , value ) ;


signature:
public class LegacyNamingStrategy { /** * Convert .
 * @ param identifier
 * the identifier
 * @ return the identifier */
private static Identifier convert ( final Identifier identifier ) { } }

implementation: if ( identifier == null || StringUtils . isBlank ( identifier . getText ( ) ) ) { return identifier ; } else { return Identifier . toIdentifier ( identifier . getText ( ) . replaceAll ( REG_EXPR , REPLACEMENT_PATTERN ) . toLowerCase ( Locale . ENGLISH ) ) ; }


signature:
public class RulesEngineImpl { /** * Insert politicians .
 * @ param ksession the ksession
 * @ param list the list */
private void insertPoliticians ( final KieSession ksession , final List < ViewRiksdagenPolitician > list ) { } }

implementation: final Map < String , List < ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual > > politicanBallotSummaryAnnualMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getIntressentId ( ) ) ) ; final Map < String , List < ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly > > politicanBallotSummaryMontlyMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getIntressentId ( ) ) ) ; final Map < String , List < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily > > politicanBallotSummaryDailyMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPoliticianSummaryDaily . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getIntressentId ( ) ) ) ; final Map < String , List < ViewRiksdagenCommitteeBallotDecisionPoliticianSummary > > decisionMap = dataViewer . findListByProperty ( ViewRiksdagenCommitteeBallotDecisionPoliticianSummary . class , new String [ ] { "2007/08" , "FöU15" } , ViewRiksdagenCommitteeBallotDecisionPoliticianSummary_ . rm , ViewRiksdagenCommitteeBallotDecisionPoliticianSummary_ . committeeReport ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getIntressentId ( ) ) ) ; for ( final ViewRiksdagenPolitician politicianData : list ) { if ( politicianData != null ) { List < ViewRiksdagenCommitteeBallotDecisionPoliticianSummary > ballots = decisionMap . get ( politicianData . getPersonId ( ) ) ; if ( ballots == null ) { ballots = new ArrayList < > ( ) ; } insertPolitician ( ksession , politicianData , politicanBallotSummaryDailyMap . get ( politicianData . getPersonId ( ) ) , politicanBallotSummaryMontlyMap . get ( politicianData . getPersonId ( ) ) , politicanBallotSummaryAnnualMap . get ( politicianData . getPersonId ( ) ) , ballots ) ; } }


signature:
public class RulesEngineImpl { /** * Insert politician .
 * @ param ksession the ksession
 * @ param politicianData the politician data
 * @ param dailyList the daily list
 * @ param monthlyList the monthly list
 * @ param annualList the annual list
 * @ param decisionList the decision list */
private static void insertPolitician ( final KieSession ksession , final ViewRiksdagenPolitician politicianData , final List < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily > dailyList , final List < ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly > monthlyList , final List < ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual > annualList , final List < ViewRiksdagenCommitteeBallotDecisionPoliticianSummary > decisionList ) { } }

implementation: if ( politicianData . isActiveParliament ( ) && dailyList != null && monthlyList != null && annualList != null ) { Collections . sort ( dailyList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPoliticianSummaryDaily > dailyListFirst = dailyList . stream ( ) . findFirst ( ) ; Collections . sort ( monthlyList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPoliticianSummaryMonthly > monthlyListFirst = monthlyList . stream ( ) . findFirst ( ) ; Collections . sort ( annualList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPoliticianSummaryAnnual > annualListFirst = annualList . stream ( ) . findFirst ( ) ; if ( annualListFirst . isPresent ( ) && monthlyListFirst . isPresent ( ) && dailyListFirst . isPresent ( ) ) { final PoliticianComplianceCheckImpl politicianComplianceCheckImpl = new PoliticianComplianceCheckImpl ( politicianData , dailyListFirst . get ( ) , monthlyListFirst . get ( ) , annualListFirst . get ( ) , decisionList ) ; ksession . insert ( politicianComplianceCheckImpl ) ; } } else { final PoliticianComplianceCheckImpl politicianComplianceCheckImpl = new PoliticianComplianceCheckImpl ( politicianData , null , null , null , new ArrayList < > ( ) ) ; ksession . insert ( politicianComplianceCheckImpl ) ; }


signature:
public class RulesEngineImpl { /** * Insert parties .
 * @ param ksession the ksession
 * @ param list the list */
private void insertParties ( final KieSession ksession , final List < ViewRiksdagenPartySummary > list ) { } }

implementation: final Map < String , List < ViewRiksdagenVoteDataBallotPartySummaryDaily > > politicanBallotSummaryAnnualMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPartySummaryDaily . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getParty ( ) ) ) ; final Map < String , List < ViewRiksdagenVoteDataBallotPartySummaryMonthly > > politicanBallotSummaryMontlyMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPartySummaryMonthly . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getParty ( ) ) ) ; final Map < String , List < ViewRiksdagenVoteDataBallotPartySummaryAnnual > > politicanBallotSummaryDailyMap = dataViewer . getAll ( ViewRiksdagenVoteDataBallotPartySummaryAnnual . class ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getParty ( ) ) ) ; final Map < String , List < ViewRiksdagenCommitteeBallotDecisionPartySummary > > decisionMap = dataViewer . findListByProperty ( ViewRiksdagenCommitteeBallotDecisionPartySummary . class , new String [ ] { "2007/08" , "FöU15" } , ViewRiksdagenCommitteeBallotDecisionPartySummary_ . rm , ViewRiksdagenCommitteeBallotDecisionPartySummary_ . committeeReport ) . stream ( ) . collect ( Collectors . groupingBy ( p -> p . getEmbeddedId ( ) . getParty ( ) ) ) ; for ( final ViewRiksdagenPartySummary partyData : list ) { if ( partyData != null ) { List < ViewRiksdagenCommitteeBallotDecisionPartySummary > ballotDecisions = decisionMap . get ( partyData . getParty ( ) ) ; if ( ballotDecisions == null ) { ballotDecisions = new ArrayList < > ( ) ; } insertParty ( ksession , partyData , politicanBallotSummaryDailyMap . get ( partyData . getParty ( ) ) , politicanBallotSummaryMontlyMap . get ( partyData . getParty ( ) ) , politicanBallotSummaryAnnualMap . get ( partyData . getParty ( ) ) , ballotDecisions ) ; } }


signature:
public class RulesEngineImpl { /** * Insert party .
 * @ param ksession the ksession
 * @ param partyData the party data
 * @ param dailyList the daily list
 * @ param monthlyList the monthly list
 * @ param annualList the annual list
 * @ param ballotDecisions the ballot decisions */
private static void insertParty ( final KieSession ksession , final ViewRiksdagenPartySummary partyData , final List < ViewRiksdagenVoteDataBallotPartySummaryAnnual > dailyList , final List < ViewRiksdagenVoteDataBallotPartySummaryMonthly > monthlyList , final List < ViewRiksdagenVoteDataBallotPartySummaryDaily > annualList , final List < ViewRiksdagenCommitteeBallotDecisionPartySummary > ballotDecisions ) { } }

implementation: if ( partyData . isActiveParliament ( ) && dailyList != null && monthlyList != null && annualList != null ) { Collections . sort ( dailyList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPartySummaryAnnual > dailyListFirst = dailyList . stream ( ) . findFirst ( ) ; Collections . sort ( monthlyList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPartySummaryMonthly > monthlyListFirst = monthlyList . stream ( ) . findFirst ( ) ; Collections . sort ( annualList , ( e1 , e2 ) -> e1 . getEmbeddedId ( ) . getVoteDate ( ) . compareTo ( e2 . getEmbeddedId ( ) . getVoteDate ( ) ) ) ; final Optional < ViewRiksdagenVoteDataBallotPartySummaryDaily > annualListFirst = annualList . stream ( ) . findFirst ( ) ; if ( annualListFirst . isPresent ( ) && monthlyListFirst . isPresent ( ) && dailyListFirst . isPresent ( ) ) { final PartyComplianceCheckImpl politicianComplianceCheckImpl = new PartyComplianceCheckImpl ( partyData , dailyListFirst . get ( ) , monthlyListFirst . get ( ) , annualListFirst . get ( ) , ballotDecisions ) ; ksession . insert ( politicianComplianceCheckImpl ) ; } } else { final PartyComplianceCheckImpl politicianComplianceCheckImpl = new PartyComplianceCheckImpl ( partyData , null , null , null , new ArrayList < > ( ) ) ; ksession . insert ( politicianComplianceCheckImpl ) ; }


signature:
public class RiksdagenCommitteeProposalApiImpl { /** * / * ( non - Javadoc )
 * @ see com . hack23 . cia . service . external . riksdagen . api . RiksdagenCommitteeProposalApi # getCommitteeProposal ( java . lang . String ) */
@ Override public CommitteeProposalComponentData getCommitteeProposal ( final String id ) throws DataFailureException { } }

implementation: try { final String url = COMMITTE_PROPOSAL . replace ( ID_KEY , id ) ; return ( ( JAXBElement < CommitteeProposalComponentData > ) xmlAgent . unmarshallXml ( riksdagenCommitteeProposalMarshaller , url , HTTP_UTSKOTTSFORSLAG_RIKSDAGEN_EXTERNAL_MODEL_CIA_HACK23_COM_IMPL , null , null ) ) . getValue ( ) ; } catch ( final XmlAgentException e ) { LOGGER . warn ( PROBLEM_GETTING_COMMITTEE_PROPOSAL_FOR_ID_S_FROM_DATA_RIKSDAGEN_SE , id ) ; throw new DataFailureException ( e ) ; }


signature:
public class AgainstProposalContainer { /** * Gets the against proposal list .
 * @ return the against proposal list */
@ OneToMany ( targetEntity = AgainstProposalData . class , cascade = { } }

implementation: CascadeType . ALL } ) @ JoinColumn ( name = "AGAINST_PROPOSAL_LIST_AGAINS_0" ) public List < AgainstProposalData > getAgainstProposalList ( ) { return this . againstProposalList ;


signature:
public class GovernmentBodyChartDataManagerImpl { /** * Adds the data serie value .
 * @ param dataSeries the data series
 * @ param entry the entry
 * @ param value the value */
private static void addDataSerieValue ( final DataSeries dataSeries , final Entry entry , final int value ) { } }

implementation: if ( entry . getKey ( ) != null && value > 0 ) { dataSeries . add ( FIRST_OF_JAN + entry . getKey ( ) , value ) ; }


signature:
public class GovernmentBodyChartDataManagerImpl { /** * Adds the annual summary .
 * @ param report
 * the report
 * @ param content
 * the content
 * @ param label
 * the label */
private void addAnnualSummary ( final Map < String , List < GovernmentBodyAnnualOutcomeSummary > > report , final VerticalLayout content , final String label ) { } }

implementation: final DataSeries dataSeries = new DataSeries ( ) ; final Series series = new Series ( ) ; for ( final Entry < String , List < GovernmentBodyAnnualOutcomeSummary > > entry : report . entrySet ( ) ) { final List < GovernmentBodyAnnualOutcomeSummary > allValues = entry . getValue ( ) ; if ( ! allValues . isEmpty ( ) ) { addAnnualSummaryData ( dataSeries , series , entry , allValues ) ; } } addChart ( content , label , new DCharts ( ) . setDataSeries ( dataSeries ) . setOptions ( getChartOptions ( ) . createOptionsXYDateFloatLogYAxisLegendOutside ( series ) ) . show ( ) , true ) ;


signature:
public class GovernmentBodyChartDataManagerImpl { /** * Adds the annual summary data .
 * @ param dataSeries the data series
 * @ param series the series
 * @ param entry the entry
 * @ param allValues the all values */
private static void addAnnualSummaryData ( final DataSeries dataSeries , final Series series , final Entry < String , List < GovernmentBodyAnnualOutcomeSummary > > entry , final List < GovernmentBodyAnnualOutcomeSummary > allValues ) { } }

implementation: series . addSeries ( new XYseries ( ) . setLabel ( entry . getKey ( ) ) . setShowLabel ( true ) ) ; dataSeries . newSeries ( ) ; final Map < Integer , List < GovernmentBodyAnnualOutcomeSummary > > map = allValues . stream ( ) . collect ( Collectors . groupingBy ( GovernmentBodyAnnualOutcomeSummary :: getYear ) ) ; for ( final Entry < Integer , List < GovernmentBodyAnnualOutcomeSummary > > data : map . entrySet ( ) ) { final List < GovernmentBodyAnnualOutcomeSummary > values = data . getValue ( ) ; final double sum = values . stream ( ) . mapToDouble ( GovernmentBodyAnnualOutcomeSummary :: getYearTotal ) . sum ( ) ; if ( sum > 0 ) { dataSeries . add ( data . getKey ( ) + FIRST_JAN_DATA_SUFFIX , ( int ) sum ) ; } }