// Path: src/main/java/com/athaydes/logfx/data/LogFile.java
// public final class LogFile {
//     public final File file;
//     private final BindableValue<String> highlightGroup = new BindableValue<>( "" );
// 
//     public LogFile( File file ) {
//         this.file = file;
//     }
// 
//     public LogFile( File file, String highlightGroupName ) {
//         this.file = file;
//         highlightGroup.setValue( highlightGroupName );
//     }
// 
//     public BindableValue<String> highlightGroupProperty() {
//         return highlightGroup;
//     }
// 
//     public String getHighlightGroup() {
//         return highlightGroup.getValue();
//     }
// 
//     @Override
//     public boolean equals( Object other ) {
//         if ( this == other ) return true;
//         if ( !( other instanceof LogFile ) ) return false;
//         LogFile logFile = ( LogFile ) other;
//         return Objects.equals( file, logFile.file );
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash( file );
//     }
// 
// }
// 
// Path: src/main/java/com/athaydes/logfx/text/HighlightExpression.java
// public final class HighlightExpression {
// 
//     private final Pattern expression;
//     private final Paint bkgColor;
//     private final Paint fillColor;
//     private final boolean isFiltered;
// 
//     public HighlightExpression( String expression, Paint bkgColor, Paint fillColor, boolean isFiltered ) {
//         this( Pattern.compile( expression ), bkgColor, fillColor, isFiltered );
//     }
// 
//     public HighlightExpression( Pattern expression, Paint bkgColor, Paint fillColor, boolean isFiltered ) {
//         this.expression = expression;
//         this.bkgColor = bkgColor;
//         this.fillColor = fillColor;
//         this.isFiltered = isFiltered;
//     }
// 
//     public Paint getBkgColor() {
//         return bkgColor;
//     }
// 
//     public Paint getFillColor() {
//         return fillColor;
//     }
// 
//     public Pattern getPattern() {
//         return expression;
//     }
// 
//     public boolean isFiltered() {
//         return isFiltered;
//     }
// 
//     public LogLineColors getLogLineColors() {
//         return new LogLineColors( bkgColor, fillColor );
//     }
// 
//     public boolean matches( String text ) {
//         if ( text == null ) {
//             text = "";
//         }
// 
//         // the find method does not anchor the String by default, unlike matches()
//         return expression.matcher( text ).find();
//     }
// 
//     public HighlightExpression withFilter( boolean enable ) {
//         return new HighlightExpression( this.expression, this.bkgColor, this.fillColor, enable );
//     }
// 
//     @Override
//     public String toString() {
//         return "{" +
//                 "expression=" + expression +
//                 ", bkgColor=" + bkgColor +
//                 ", fillColor=" + fillColor +
//                 ", isFiltered=" + isFiltered +
//                 '}';
//     }
// 
//     @Override
//     public boolean equals( Object o ) {
//         if ( this == o ) return true;
//         if ( o == null || getClass() != o.getClass() ) return false;
//         HighlightExpression that = ( HighlightExpression ) o;
//         return isFiltered == that.isFiltered &&
//                 expression.toString().equals( that.expression.toString() ) &&
//                 bkgColor.equals( that.bkgColor ) &&
//                 fillColor.equals( that.fillColor );
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash( expression.toString(), bkgColor, fillColor, isFiltered );
//     }
// }


import com.athaydes.logfx.data.LogFile;
import com.athaydes.logfx.text.HighlightExpression;
import javafx.beans.InvalidationListener;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.collections.ObservableSet;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
package com.athaydes.logfx.config;



public final class HighlightGroups {
    private final ObservableSet<LogFile> observableFiles;
    private final ObservableMap<String, ObservableList<HighlightExpression>> configByGroupName;

    private InvalidationListener invalidationListener;

    public HighlightGroups( ObservableSet<LogFile> observableFiles ) {
        this.observableFiles = observableFiles;
        configByGroupName = FXCollections.observableMap( new LinkedHashMap<>( 4 ) );
        configByGroupName.put( "", createNewExpressions( null ) );
    }

    public ObservableList<HighlightExpression> getByName( String name ) {
        return configByGroupName.get( name );
    }

// Path: src/main/java/com/athaydes/logfx/data/LogFile.java
// public final class LogFile {
//     public final File file;
//     private final BindableValue<String> highlightGroup = new BindableValue<>( "" );
// 
//     public LogFile( File file ) {
//         this.file = file;
//     }
// 
//     public LogFile( File file, String highlightGroupName ) {
//         this.file = file;
//         highlightGroup.setValue( highlightGroupName );
//     }
// 
//     public BindableValue<String> highlightGroupProperty() {
//         return highlightGroup;
//     }
// 
//     public String getHighlightGroup() {
//         return highlightGroup.getValue();
//     }
// 
//     @Override
//     public boolean equals( Object other ) {
//         if ( this == other ) return true;
//         if ( !( other instanceof LogFile ) ) return false;
//         LogFile logFile = ( LogFile ) other;
//         return Objects.equals( file, logFile.file );
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash( file );
//     }
// 
// }
// 
// Path: src/main/java/com/athaydes/logfx/text/HighlightExpression.java
// public final class HighlightExpression {
// 
//     private final Pattern expression;
//     private final Paint bkgColor;
//     private final Paint fillColor;
//     private final boolean isFiltered;
// 
//     public HighlightExpression( String expression, Paint bkgColor, Paint fillColor, boolean isFiltered ) {
//         this( Pattern.compile( expression ), bkgColor, fillColor, isFiltered );
//     }
// 
//     public HighlightExpression( Pattern expression, Paint bkgColor, Paint fillColor, boolean isFiltered ) {
//         this.expression = expression;
//         this.bkgColor = bkgColor;
//         this.fillColor = fillColor;
//         this.isFiltered = isFiltered;
//     }
// 
//     public Paint getBkgColor() {
//         return bkgColor;
//     }
// 
//     public Paint getFillColor() {
//         return fillColor;
//     }
// 
//     public Pattern getPattern() {
//         return expression;
//     }
// 
//     public boolean isFiltered() {
//         return isFiltered;
//     }
// 
//     public LogLineColors getLogLineColors() {
//         return new LogLineColors( bkgColor, fillColor );
//     }
// 
//     public boolean matches( String text ) {
//         if ( text == null ) {
//             text = "";
//         }
// 
//         // the find method does not anchor the String by default, unlike matches()
//         return expression.matcher( text ).find();
//     }
// 
//     public HighlightExpression withFilter( boolean enable ) {
//         return new HighlightExpression( this.expression, this.bkgColor, this.fillColor, enable );
//     }
// 
//     @Override
//     public String toString() {
//         return "{" +
//                 "expression=" + expression +
//                 ", bkgColor=" + bkgColor +
//                 ", fillColor=" + fillColor +
//                 ", isFiltered=" + isFiltered +
//                 '}';
//     }
// 
//     @Override
//     public boolean equals( Object o ) {
//         if ( this == o ) return true;
//         if ( o == null || getClass() != o.getClass() ) return false;
//         HighlightExpression that = ( HighlightExpression ) o;
//         return isFiltered == that.isFiltered &&
//                 expression.toString().equals( that.expression.toString() ) &&
//                 bkgColor.equals( that.bkgColor ) &&
//                 fillColor.equals( that.fillColor );
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash( expression.toString(), bkgColor, fillColor, isFiltered );
//     }
// }


// Path: src/main/java/com/athaydes/logfx/config/HighlightGroups.java
import com.athaydes.logfx.data.LogFile;
import com.athaydes.logfx.text.HighlightExpression;
import javafx.beans.InvalidationListener;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.collections.ObservableSet;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

package com.athaydes.logfx.config;



public final class HighlightGroups {
    private final ObservableSet<LogFile> observableFiles;
    private final ObservableMap<String, ObservableList<HighlightExpression>> configByGroupName;

    private InvalidationListener invalidationListener;

    public HighlightGroups( ObservableSet<LogFile> observableFiles ) {
        this.observableFiles = observableFiles;
        configByGroupName = FXCollections.observableMap( new LinkedHashMap<>( 4 ) );
        configByGroupName.put( "", createNewExpressions( null ) );
    }

    public ObservableList<HighlightExpression> getByName( String name ) {
        return configByGroupName.get( name );
    }

    public ObservableList<HighlightExpression> getDefault() {